<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: menu   menu.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>Menu&nbsp; <span class="subtitle">2.7.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_menu.html" title="menu">menu</a>
                
                 &gt; menu.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="o">(</span><span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">,</span>

	<span class="c">// String constants</span>
<span class="c"></span>	
		<span class="nx">_MENU</span> <span class="o">=</span> <span class="s2">&quot;Menu&quot;</span><span class="o">,</span>
		<span class="nx">_DIV_UPPERCASE</span> <span class="o">=</span> <span class="s2">&quot;DIV&quot;</span><span class="o">,</span>
		<span class="nx">_DIV_LOWERCASE</span> <span class="o">=</span> <span class="s2">&quot;div&quot;</span><span class="o">,</span>
		<span class="nx">_ID</span> <span class="o">=</span> <span class="s2">&quot;id&quot;</span><span class="o">,</span>
		<span class="nx">_SELECT</span> <span class="o">=</span> <span class="s2">&quot;SELECT&quot;</span><span class="o">,</span>
		<span class="nx">_XY</span> <span class="o">=</span> <span class="s2">&quot;xy&quot;</span><span class="o">,</span>
		<span class="nx">_Y</span> <span class="o">=</span> <span class="s2">&quot;y&quot;</span><span class="o">,</span>
		<span class="nx">_UL_UPPERCASE</span> <span class="o">=</span> <span class="s2">&quot;UL&quot;</span><span class="o">,</span>
		<span class="nx">_UL_LOWERCASE</span> <span class="o">=</span> <span class="s2">&quot;ul&quot;</span><span class="o">,</span>
		<span class="nx">_FIRST_OF_TYPE</span> <span class="o">=</span> <span class="s2">&quot;first-of-type&quot;</span><span class="o">,</span>
		<span class="nx">_LI</span> <span class="o">=</span> <span class="s2">&quot;LI&quot;</span><span class="o">,</span>
		<span class="nx">_OPTGROUP</span> <span class="o">=</span> <span class="s2">&quot;OPTGROUP&quot;</span><span class="o">,</span>
		<span class="nx">_OPTION</span> <span class="o">=</span> <span class="s2">&quot;OPTION&quot;</span><span class="o">,</span>
		<span class="nx">_DISABLED</span> <span class="o">=</span> <span class="s2">&quot;disabled&quot;</span><span class="o">,</span>
		<span class="nx">_NONE</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="o">,</span>
		<span class="nx">_SELECTED</span> <span class="o">=</span> <span class="s2">&quot;selected&quot;</span><span class="o">,</span>
		<span class="nx">_GROUP_INDEX</span> <span class="o">=</span> <span class="s2">&quot;groupindex&quot;</span><span class="o">,</span>
		<span class="nx">_INDEX</span> <span class="o">=</span> <span class="s2">&quot;index&quot;</span><span class="o">,</span>
		<span class="nx">_SUBMENU</span> <span class="o">=</span> <span class="s2">&quot;submenu&quot;</span><span class="o">,</span>
		<span class="nx">_VISIBLE</span> <span class="o">=</span> <span class="s2">&quot;visible&quot;</span><span class="o">,</span>
		<span class="nx">_HIDE_DELAY</span> <span class="o">=</span> <span class="s2">&quot;hidedelay&quot;</span><span class="o">,</span>
		<span class="nx">_POSITION</span> <span class="o">=</span> <span class="s2">&quot;position&quot;</span><span class="o">,</span>
		<span class="nx">_DYNAMIC</span> <span class="o">=</span> <span class="s2">&quot;dynamic&quot;</span><span class="o">,</span>
		<span class="nx">_STATIC</span> <span class="o">=</span> <span class="s2">&quot;static&quot;</span><span class="o">,</span>
		<span class="nx">_DYNAMIC_STATIC</span> <span class="o">=</span> <span class="nx">_DYNAMIC</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">_STATIC</span><span class="o">,</span>
		<span class="nx">_WINDOWS</span> <span class="o">=</span> <span class="s2">&quot;windows&quot;</span><span class="o">,</span>
		<span class="nx">_URL</span> <span class="o">=</span> <span class="s2">&quot;url&quot;</span><span class="o">,</span>
		<span class="nx">_HASH</span> <span class="o">=</span> <span class="s2">&quot;#&quot;</span><span class="o">,</span>
		<span class="nx">_TARGET</span> <span class="o">=</span> <span class="s2">&quot;target&quot;</span><span class="o">,</span>
		<span class="nx">_MAX_HEIGHT</span> <span class="o">=</span> <span class="s2">&quot;maxheight&quot;</span><span class="o">,</span>
        <span class="nx">_TOP_SCROLLBAR</span> <span class="o">=</span> <span class="s2">&quot;topscrollbar&quot;</span><span class="o">,</span>
        <span class="nx">_BOTTOM_SCROLLBAR</span> <span class="o">=</span> <span class="s2">&quot;bottomscrollbar&quot;</span><span class="o">,</span>
        <span class="nx">_UNDERSCORE</span> <span class="o">=</span> <span class="s2">&quot;_&quot;</span><span class="o">,</span>
		<span class="nx">_TOP_SCROLLBAR_DISABLED</span> <span class="o">=</span> <span class="nx">_TOP_SCROLLBAR</span> <span class="o">+</span> <span class="nx">_UNDERSCORE</span> <span class="o">+</span> <span class="nx">_DISABLED</span><span class="o">,</span>
		<span class="nx">_BOTTOM_SCROLLBAR_DISABLED</span> <span class="o">=</span> <span class="nx">_BOTTOM_SCROLLBAR</span> <span class="o">+</span> <span class="nx">_UNDERSCORE</span> <span class="o">+</span> <span class="nx">_DISABLED</span><span class="o">,</span>
		<span class="nx">_MOUSEMOVE</span> <span class="o">=</span> <span class="s2">&quot;mousemove&quot;</span><span class="o">,</span>
		<span class="nx">_SHOW_DELAY</span> <span class="o">=</span> <span class="s2">&quot;showdelay&quot;</span><span class="o">,</span>
		<span class="nx">_SUBMENU_HIDE_DELAY</span> <span class="o">=</span> <span class="s2">&quot;submenuhidedelay&quot;</span><span class="o">,</span>
		<span class="nx">_IFRAME</span> <span class="o">=</span> <span class="s2">&quot;iframe&quot;</span><span class="o">,</span>
		<span class="nx">_CONSTRAIN_TO_VIEWPORT</span> <span class="o">=</span> <span class="s2">&quot;constraintoviewport&quot;</span><span class="o">,</span>
		<span class="nx">_PREVENT_CONTEXT_OVERLAP</span> <span class="o">=</span> <span class="s2">&quot;preventcontextoverlap&quot;</span><span class="o">,</span>
		<span class="nx">_SUBMENU_ALIGNMENT</span> <span class="o">=</span> <span class="s2">&quot;submenualignment&quot;</span><span class="o">,</span>
		<span class="nx">_AUTO_SUBMENU_DISPLAY</span> <span class="o">=</span> <span class="s2">&quot;autosubmenudisplay&quot;</span><span class="o">,</span>
		<span class="nx">_CLICK_TO_HIDE</span> <span class="o">=</span> <span class="s2">&quot;clicktohide&quot;</span><span class="o">,</span>
		<span class="nx">_CONTAINER</span> <span class="o">=</span> <span class="s2">&quot;container&quot;</span><span class="o">,</span>
		<span class="nx">_SCROLL_INCREMENT</span> <span class="o">=</span> <span class="s2">&quot;scrollincrement&quot;</span><span class="o">,</span>
		<span class="nx">_MIN_SCROLL_HEIGHT</span> <span class="o">=</span> <span class="s2">&quot;minscrollheight&quot;</span><span class="o">,</span>
		<span class="nx">_CLASSNAME</span> <span class="o">=</span> <span class="s2">&quot;classname&quot;</span><span class="o">,</span>
		<span class="nx">_SHADOW</span> <span class="o">=</span> <span class="s2">&quot;shadow&quot;</span><span class="o">,</span>
		<span class="nx">_KEEP_OPEN</span> <span class="o">=</span> <span class="s2">&quot;keepopen&quot;</span><span class="o">,</span>
		<span class="nx">_HD</span> <span class="o">=</span> <span class="s2">&quot;hd&quot;</span><span class="o">,</span>
		<span class="nx">_HAS_TITLE</span> <span class="o">=</span> <span class="s2">&quot;hastitle&quot;</span><span class="o">,</span>
		<span class="nx">_CONTEXT</span> <span class="o">=</span> <span class="s2">&quot;context&quot;</span><span class="o">,</span>
		<span class="nx">_EMPTY_STRING</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="o">,</span>
		<span class="nx">_MOUSEDOWN</span> <span class="o">=</span> <span class="s2">&quot;mousedown&quot;</span><span class="o">,</span>
		<span class="nx">_KEYDOWN</span> <span class="o">=</span> <span class="s2">&quot;keydown&quot;</span><span class="o">,</span>
		<span class="nx">_HEIGHT</span> <span class="o">=</span> <span class="s2">&quot;height&quot;</span><span class="o">,</span>
		<span class="nx">_WIDTH</span> <span class="o">=</span> <span class="s2">&quot;width&quot;</span><span class="o">,</span>
		<span class="nx">_PX</span> <span class="o">=</span> <span class="s2">&quot;px&quot;</span><span class="o">,</span>
		<span class="nx">_EFFECT</span> <span class="o">=</span> <span class="s2">&quot;effect&quot;</span><span class="o">,</span>
		<span class="nx">_MONITOR_RESIZE</span> <span class="o">=</span> <span class="s2">&quot;monitorresize&quot;</span><span class="o">,</span>
		<span class="nx">_DISPLAY</span> <span class="o">=</span> <span class="s2">&quot;display&quot;</span><span class="o">,</span>
		<span class="nx">_BLOCK</span> <span class="o">=</span> <span class="s2">&quot;block&quot;</span><span class="o">,</span>
		<span class="nx">_VISIBILITY</span> <span class="o">=</span> <span class="s2">&quot;visibility&quot;</span><span class="o">,</span>
		<span class="nx">_ABSOLUTE</span> <span class="o">=</span> <span class="s2">&quot;absolute&quot;</span><span class="o">,</span>
		<span class="nx">_ZINDEX</span> <span class="o">=</span> <span class="s2">&quot;zindex&quot;</span><span class="o">,</span>
		<span class="nx">_YUI_MENU_BODY_SCROLLED</span> <span class="o">=</span> <span class="s2">&quot;yui-menu-body-scrolled&quot;</span><span class="o">,</span>
		<span class="nx">_NON_BREAKING_SPACE</span> <span class="o">=</span> <span class="s2">&quot;&amp;#32;&quot;</span><span class="o">,</span>
		<span class="nx">_SPACE</span> <span class="o">=</span> <span class="s2">&quot; &quot;</span><span class="o">,</span>
		<span class="nx">_MOUSEOVER</span> <span class="o">=</span> <span class="s2">&quot;mouseover&quot;</span><span class="o">,</span>
		<span class="nx">_MOUSEOUT</span> <span class="o">=</span> <span class="s2">&quot;mouseout&quot;</span><span class="o">,</span>
        <span class="nx">_ITEM_ADDED</span> <span class="o">=</span> <span class="s2">&quot;itemAdded&quot;</span><span class="o">,</span>
        <span class="nx">_ITEM_REMOVED</span> <span class="o">=</span> <span class="s2">&quot;itemRemoved&quot;</span><span class="o">,</span>
        <span class="nx">_HIDDEN</span> <span class="o">=</span> <span class="s2">&quot;hidden&quot;</span><span class="o">,</span>
        <span class="nx">_YUI_MENU_SHADOW</span> <span class="o">=</span> <span class="s2">&quot;yui-menu-shadow&quot;</span><span class="o">,</span>
        <span class="nx">_YUI_MENU_SHADOW_VISIBLE</span> <span class="o">=</span> <span class="nx">_YUI_MENU_SHADOW</span> <span class="o">+</span> <span class="s2">&quot;-visible&quot;</span><span class="o">,</span>
        <span class="nx">_YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE</span> <span class="o">=</span> <span class="nx">_YUI_MENU_SHADOW</span> <span class="o">+</span> <span class="nx">_SPACE</span> <span class="o">+</span> <span class="nx">_YUI_MENU_SHADOW_VISIBLE</span><span class="o">;</span>


<span class="c">/**</span>
<span class="c">* The Menu class creates a container that holds a vertical list representing </span>
<span class="c">* a set of options or commands.  Menu is the base class for all </span>
<span class="c">* menu containers. </span>
<span class="c">* @param {String} p_oElement String specifying the id attribute of the </span>
<span class="c">* &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element of the menu.</span>
<span class="c">* @param {String} p_oElement String specifying the id attribute of the </span>
<span class="c">* &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; element to be used as the data source </span>
<span class="c">* for the menu.</span>
<span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="c">* level-one-html.html#ID-22445964&quot;&gt;HTMLDivElement&lt;/a&gt;} p_oElement Object </span>
<span class="c">* specifying the &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element of the menu.</span>
<span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="c">* level-one-html.html#ID-94282980&quot;&gt;HTMLSelectElement&lt;/a&gt;} p_oElement </span>
<span class="c">* Object specifying the &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; element to be used as </span>
<span class="c">* the data source for the menu.</span>
<span class="c">* @param {Object} p_oConfig Optional. Object literal specifying the </span>
<span class="c">* configuration for the menu. See configuration class documentation for </span>
<span class="c">* more details.</span>
<span class="c">* @namespace YAHOO.widget</span>
<span class="c">* @class Menu</span>
<span class="c">* @constructor</span>
<span class="c">* @extends YAHOO.widget.Overlay</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Menu</span> <span class="o">=</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">lazyLoad</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">lazyLoad</span> <span class="o">||</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">lazyload</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">itemData</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">itemData</span> <span class="o">||</span> <span class="nx">p_oConfig</span><span class="o">.</span><span class="nx">itemdata</span><span class="o">;</span>

    <span class="o">}</span>


    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">constructor</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oConfig</span><span class="o">);</span>

<span class="o">};</span>



<span class="c">/**</span>
<span class="c">* @method checkPosition</span>
<span class="c">* @description Checks to make sure that the value of the &quot;position&quot; property </span>
<span class="c">* is one of the supported strings. Returns true if the position is supported.</span>
<span class="c">* @private</span>
<span class="c">* @param {Object} p_sPosition String specifying the position of the menu.</span>
<span class="c">* @return {Boolean}</span>
<span class="c">*/</span>
<span class="k">function</span> <span class="nx">checkPosition</span><span class="o">(</span><span class="nx">p_sPosition</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">returnVal</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">p_sPosition</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">returnVal</span> <span class="o">=</span> <span class="o">(</span><span class="nx">_DYNAMIC_STATIC</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">((</span><span class="nx">p_sPosition</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()))</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">);</span>

    <span class="o">}</span>

	<span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">}</span>


<span class="k">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">,</span>
    <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">,</span>
    <span class="nx">Module</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Module</span><span class="o">,</span>
    <span class="nx">Overlay</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Overlay</span><span class="o">,</span>
    <span class="nx">Menu</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Menu</span><span class="o">,</span>
    <span class="nx">MenuManager</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuManager</span><span class="o">,</span>
    <span class="nx">CustomEvent</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">,</span>
    <span class="nx">UA</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">,</span>
    
    <span class="nx">m_oShadowTemplate</span><span class="o">,</span>

	<span class="nx">EVENT_TYPES</span> <span class="o">=</span> <span class="o">[</span>
    
		<span class="o">[</span><span class="s2">&quot;mouseOverEvent&quot;</span><span class="o">,</span> <span class="nx">_MOUSEOVER</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;mouseOutEvent&quot;</span><span class="o">,</span> <span class="nx">_MOUSEOUT</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;mouseDownEvent&quot;</span><span class="o">,</span> <span class="nx">_MOUSEDOWN</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;mouseUpEvent&quot;</span><span class="o">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;clickEvent&quot;</span><span class="o">,</span> <span class="s2">&quot;click&quot;</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;keyPressEvent&quot;</span><span class="o">,</span> <span class="s2">&quot;keypress&quot;</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;keyDownEvent&quot;</span><span class="o">,</span> <span class="nx">_KEYDOWN</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;keyUpEvent&quot;</span><span class="o">,</span> <span class="s2">&quot;keyup&quot;</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;focusEvent&quot;</span><span class="o">,</span> <span class="s2">&quot;focus&quot;</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;blurEvent&quot;</span><span class="o">,</span> <span class="s2">&quot;blur&quot;</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;itemAddedEvent&quot;</span><span class="o">,</span> <span class="nx">_ITEM_ADDED</span><span class="o">],</span>
		<span class="o">[</span><span class="s2">&quot;itemRemovedEvent&quot;</span><span class="o">,</span> <span class="nx">_ITEM_REMOVED</span><span class="o">]</span>

	<span class="o">],</span>

	<span class="nx">VISIBLE_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_VISIBLE</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span>
	<span class="o">},</span> 

	<span class="nx">CONSTRAIN_TO_VIEWPORT_CONFIG</span> <span class="o">=</span>  <span class="o">{</span>
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_CONSTRAIN_TO_VIEWPORT</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span> 
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_IFRAME</span><span class="o">,</span><span class="s2">&quot;x&quot;</span><span class="o">,</span><span class="nx">_Y</span><span class="o">,</span><span class="nx">_XY</span><span class="o">]</span>
	<span class="o">},</span> 

	<span class="nx">PREVENT_CONTEXT_OVERLAP_CONFIG</span> <span class="o">=</span>  <span class="o">{</span>
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_PREVENT_CONTEXT_OVERLAP</span><span class="o">,</span>
		<span class="nx">value</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>  
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_CONSTRAIN_TO_VIEWPORT</span><span class="o">]</span>
	<span class="o">},</span>

	<span class="nx">POSITION_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_POSITION</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="nx">_DYNAMIC</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">checkPosition</span><span class="o">,</span> 
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_VISIBLE</span><span class="o">,</span> <span class="nx">_IFRAME</span><span class="o">]</span>
	<span class="o">},</span> 

	<span class="nx">SUBMENU_ALIGNMENT_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_SUBMENU_ALIGNMENT</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="o">[</span><span class="s2">&quot;tl&quot;</span><span class="o">,</span><span class="s2">&quot;tr&quot;</span><span class="o">]</span>
	<span class="o">},</span>

	<span class="nx">AUTO_SUBMENU_DISPLAY_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_AUTO_SUBMENU_DISPLAY</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">SHOW_DELAY_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_SHOW_DELAY</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="m">250</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span> 
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">HIDE_DELAY_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_HIDE_DELAY</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span> 
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">SUBMENU_HIDE_DELAY_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_SUBMENU_HIDE_DELAY</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="m">250</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">CLICK_TO_HIDE_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_CLICK_TO_HIDE</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span>

	<span class="nx">CONTAINER_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_CONTAINER</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">SCROLL_INCREMENT_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_SCROLL_INCREMENT</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="m">1</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_MAX_HEIGHT</span><span class="o">],</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span>

	<span class="nx">MIN_SCROLL_HEIGHT_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="m">90</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_MAX_HEIGHT</span><span class="o">],</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span>    

	<span class="nx">MAX_HEIGHT_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_MAX_HEIGHT</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_IFRAME</span><span class="o">],</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">CLASS_NAME_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_CLASSNAME</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span> 

	<span class="nx">DISABLED_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_DISABLED</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span>
	<span class="o">},</span>
	
	<span class="nx">SHADOW_CONFIG</span> <span class="o">=</span>  <span class="o">{</span> 
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_SHADOW</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
		<span class="nx">suppressEvent</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
		<span class="nx">supercedes</span><span class="o">:</span> <span class="o">[</span><span class="nx">_VISIBLE</span><span class="o">]</span>
	<span class="o">},</span>
	
	<span class="nx">KEEP_OPEN_CONFIG</span> <span class="o">=</span> <span class="o">{</span>
		<span class="nx">key</span><span class="o">:</span> <span class="nx">_KEEP_OPEN</span><span class="o">,</span> 
		<span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isBoolean</span>
	<span class="o">};</span>



<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">Menu</span><span class="o">,</span> <span class="nx">Overlay</span><span class="o">,</span> <span class="o">{</span>


<span class="c">// Constants</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @property CSS_CLASS_NAME</span>
<span class="c">* @description String representing the CSS class(es) to be applied to the </span>
<span class="c">* menu&#39;s &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element.</span>
<span class="c">* @default &quot;yuimenu&quot;</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">CSS_CLASS_NAME</span><span class="o">:</span> <span class="s2">&quot;yuimenu&quot;</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property ITEM_TYPE</span>
<span class="c">* @description Object representing the type of menu item to instantiate and </span>
<span class="c">* add when parsing the child nodes (either &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element, </span>
<span class="c">* &lt;code&gt;&amp;#60;optgroup&amp;#62;&lt;/code&gt; element or &lt;code&gt;&amp;#60;option&amp;#62;&lt;/code&gt;) </span>
<span class="c">* of the menu&#39;s source HTML element.</span>
<span class="c">* @default YAHOO.widget.MenuItem</span>
<span class="c">* @final</span>
<span class="c">* @type YAHOO.widget.MenuItem</span>
<span class="c">*/</span>
<span class="nx">ITEM_TYPE</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property GROUP_TITLE_TAG_NAME</span>
<span class="c">* @description String representing the tagname of the HTML element used to </span>
<span class="c">* title the menu&#39;s item groups.</span>
<span class="c">* @default H6</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">GROUP_TITLE_TAG_NAME</span><span class="o">:</span> <span class="s2">&quot;h6&quot;</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property OFF_SCREEN_POSITION</span>
<span class="c">* @description Array representing the default x and y position that a menu </span>
<span class="c">* should have when it is positioned outside the viewport by the </span>
<span class="c">* &quot;poistionOffScreen&quot; method.</span>
<span class="c">* @default &quot;-999em&quot;</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">OFF_SCREEN_POSITION</span><span class="o">:</span> <span class="s2">&quot;-999em&quot;</span><span class="o">,</span>


<span class="c">// Private properties</span>
<span class="c"></span>

<span class="c">/** </span>
<span class="c">* @property _useHideDelay</span>
<span class="c">* @description Boolean indicating if the &quot;mouseover&quot; and &quot;mouseout&quot; event </span>
<span class="c">* handlers used for hiding the menu via a call to &quot;YAHOO.lang.later&quot; have </span>
<span class="c">* already been assigned.</span>
<span class="c">* @default false</span>
<span class="c">* @private</span>
<span class="c">* @type Boolean</span>
<span class="c">*/</span>
<span class="nx">_useHideDelay</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _bHandledMouseOverEvent</span>
<span class="c">* @description Boolean indicating the current state of the menu&#39;s </span>
<span class="c">* &quot;mouseover&quot; event.</span>
<span class="c">* @default false</span>
<span class="c">* @private</span>
<span class="c">* @type Boolean</span>
<span class="c">*/</span>
<span class="nx">_bHandledMouseOverEvent</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _bHandledMouseOutEvent</span>
<span class="c">* @description Boolean indicating the current state of the menu&#39;s</span>
<span class="c">* &quot;mouseout&quot; event.</span>
<span class="c">* @default false</span>
<span class="c">* @private</span>
<span class="c">* @type Boolean</span>
<span class="c">*/</span>
<span class="nx">_bHandledMouseOutEvent</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _aGroupTitleElements</span>
<span class="c">* @description Array of HTML element used to title groups of menu items.</span>
<span class="c">* @default []</span>
<span class="c">* @private</span>
<span class="c">* @type Array</span>
<span class="c">*/</span>
<span class="nx">_aGroupTitleElements</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _aItemGroups</span>
<span class="c">* @description Multi-dimensional Array representing the menu items as they</span>
<span class="c">* are grouped in the menu.</span>
<span class="c">* @default []</span>
<span class="c">* @private</span>
<span class="c">* @type Array</span>
<span class="c">*/</span>
<span class="nx">_aItemGroups</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _aListElements</span>
<span class="c">* @description Array of &lt;code&gt;&amp;#60;ul&amp;#62;&lt;/code&gt; elements, each of which is </span>
<span class="c">* the parent node for each item&#39;s &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; element.</span>
<span class="c">* @default []</span>
<span class="c">* @private</span>
<span class="c">* @type Array</span>
<span class="c">*/</span>
<span class="nx">_aListElements</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _nCurrentMouseX</span>
<span class="c">* @description The current x coordinate of the mouse inside the area of </span>
<span class="c">* the menu.</span>
<span class="c">* @default 0</span>
<span class="c">* @private</span>
<span class="c">* @type Number</span>
<span class="c">*/</span>
<span class="nx">_nCurrentMouseX</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _bStopMouseEventHandlers</span>
<span class="c">* @description Stops &quot;mouseover,&quot; &quot;mouseout,&quot; and &quot;mousemove&quot; event handlers </span>
<span class="c">* from executing.</span>
<span class="c">* @default false</span>
<span class="c">* @private</span>
<span class="c">* @type Boolean</span>
<span class="c">*/</span>
<span class="nx">_bStopMouseEventHandlers</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property _sClassName</span>
<span class="c">* @description The current value of the &quot;classname&quot; configuration attribute.</span>
<span class="c">* @default null</span>
<span class="c">* @private</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">_sClassName</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>



<span class="c">// Public properties</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @property lazyLoad</span>
<span class="c">* @description Boolean indicating if the menu&#39;s &quot;lazy load&quot; feature is </span>
<span class="c">* enabled.  If set to &quot;true,&quot; initialization and rendering of the menu&#39;s </span>
<span class="c">* items will be deferred until the first time it is made visible.  This </span>
<span class="c">* property should be set via the constructor using the configuration </span>
<span class="c">* object literal.</span>
<span class="c">* @default false</span>
<span class="c">* @type Boolean</span>
<span class="c">*/</span>
<span class="nx">lazyLoad</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property itemData</span>
<span class="c">* @description Array of items to be added to the menu.  The array can contain </span>
<span class="c">* strings representing the text for each item to be created, object literals </span>
<span class="c">* representing the menu item configuration properties, or MenuItem instances.  </span>
<span class="c">* This property should be set via the constructor using the configuration </span>
<span class="c">* object literal.</span>
<span class="c">* @default null</span>
<span class="c">* @type Array</span>
<span class="c">*/</span>
<span class="nx">itemData</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property activeItem</span>
<span class="c">* @description Object reference to the item in the menu that has is selected.</span>
<span class="c">* @default null</span>
<span class="c">* @type YAHOO.widget.MenuItem</span>
<span class="c">*/</span>
<span class="nx">activeItem</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property parent</span>
<span class="c">* @description Object reference to the menu&#39;s parent menu or menu item.  </span>
<span class="c">* This property can be set via the constructor using the configuration </span>
<span class="c">* object literal.</span>
<span class="c">* @default null</span>
<span class="c">* @type YAHOO.widget.MenuItem</span>
<span class="c">*/</span>
<span class="nx">parent</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>


<span class="c">/**</span>
<span class="c">* @property srcElement</span>
<span class="c">* @description Object reference to the HTML element (either </span>
<span class="c">* &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; or &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt;) used to </span>
<span class="c">* create the menu.</span>
<span class="c">* @default null</span>
<span class="c">* @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="c">* level-one-html.html#ID-94282980&quot;&gt;HTMLSelectElement&lt;/a&gt;|&lt;a </span>
<span class="c">* href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.</span>
<span class="c">* html#ID-22445964&quot;&gt;HTMLDivElement&lt;/a&gt;</span>
<span class="c">*/</span>
<span class="nx">srcElement</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>



<span class="c">// Events</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @event mouseOverEvent</span>
<span class="c">* @description Fires when the mouse has entered the menu.  Passes back </span>
<span class="c">* the DOM Event object as an argument.</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event mouseOutEvent</span>
<span class="c">* @description Fires when the mouse has left the menu.  Passes back the DOM </span>
<span class="c">* Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event mouseDownEvent</span>
<span class="c">* @description Fires when the user mouses down on the menu.  Passes back the </span>
<span class="c">* DOM Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event mouseUpEvent</span>
<span class="c">* @description Fires when the user releases a mouse button while the mouse is </span>
<span class="c">* over the menu.  Passes back the DOM Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event clickEvent</span>
<span class="c">* @description Fires when the user clicks the on the menu.  Passes back the </span>
<span class="c">* DOM Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event keyPressEvent</span>
<span class="c">* @description Fires when the user presses an alphanumeric key when one of the</span>
<span class="c">* menu&#39;s items has focus.  Passes back the DOM Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event keyDownEvent</span>
<span class="c">* @description Fires when the user presses a key when one of the menu&#39;s items </span>
<span class="c">* has focus.  Passes back the DOM Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event keyUpEvent</span>
<span class="c">* @description Fires when the user releases a key when one of the menu&#39;s items </span>
<span class="c">* has focus.  Passes back the DOM Event object as an argument.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event itemAddedEvent</span>
<span class="c">* @description Fires when an item is added to the menu.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @event itemRemovedEvent</span>
<span class="c">* @description Fires when an item is removed to the menu.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>


<span class="c">/**</span>
<span class="c">* @method init</span>
<span class="c">* @description The Menu class&#39;s initialization method. This method is </span>
<span class="c">* automatically called by the constructor, and sets up all DOM references </span>
<span class="c">* for pre-existing markup, and creates required markup if it is not </span>
<span class="c">* already present.</span>
<span class="c">* @param {String} p_oElement String specifying the id attribute of the </span>
<span class="c">* &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element of the menu.</span>
<span class="c">* @param {String} p_oElement String specifying the id attribute of the </span>
<span class="c">* &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; element to be used as the data source </span>
<span class="c">* for the menu.</span>
<span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="c">* level-one-html.html#ID-22445964&quot;&gt;HTMLDivElement&lt;/a&gt;} p_oElement Object </span>
<span class="c">* specifying the &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element of the menu.</span>
<span class="c">* @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="c">* level-one-html.html#ID-94282980&quot;&gt;HTMLSelectElement&lt;/a&gt;} p_oElement </span>
<span class="c">* Object specifying the &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; element to be used as </span>
<span class="c">* the data source for the menu.</span>
<span class="c">* @param {Object} p_oConfig Optional. Object literal specifying the </span>
<span class="c">* configuration for the menu. See configuration class documentation for </span>
<span class="c">* more details.</span>
<span class="c">*/</span>
<span class="nx">init</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span> <span class="o">=</span> <span class="o">[];</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span> <span class="o">=</span> <span class="o">[];</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span> <span class="o">=</span> <span class="o">[];</span>

    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuItem</span><span class="o">;</span>

    <span class="o">}</span>


    <span class="k">var</span> <span class="nx">oElement</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">p_oElement</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">oElement</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">p_oElement</span><span class="o">);</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">p_oElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oElement</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="o">;</span>

    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">switch</span><span class="o">(</span><span class="nx">oElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
    
            <span class="nx">case</span> <span class="nx">_DIV_UPPERCASE</span><span class="o">:</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">=</span> <span class="nx">oElement</span><span class="o">;</span>

                <span class="k">if</span> <span class="o">(!</span><span class="nx">oElement</span><span class="o">.</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>

                    <span class="nx">oElement</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="nx">_ID</span><span class="o">,</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">());</span>

                <span class="o">}</span>


                <span class="c">/* </span>
<span class="c">                    Note: we don&#39;t pass the user config in here yet </span>
<span class="c">                    because we only want it executed once, at the lowest </span>
<span class="c">                    subclass level.</span>
<span class="c">                */</span> 
            
                <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">init</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">oElement</span><span class="o">);</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">beforeInitEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">Menu</span><span class="o">);</span>

                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Source element: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    
            <span class="k">break</span><span class="o">;</span>
    
            <span class="nx">case</span> <span class="nx">_SELECT</span><span class="o">:</span>
    
                <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">=</span> <span class="nx">oElement</span><span class="o">;</span>

    
                <span class="c">/*</span>
<span class="c">                    The source element is not something that we can use </span>
<span class="c">                    outright, so we need to create a new Overlay</span>
<span class="c"></span>
<span class="c">                    Note: we don&#39;t pass the user config in here yet </span>
<span class="c">                    because we only want it executed once, at the lowest </span>
<span class="c">                    subclass level.</span>
<span class="c">                */</span> 

                <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">init</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">());</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">beforeInitEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">Menu</span><span class="o">);</span>

				<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Source element: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

            <span class="k">break</span><span class="o">;</span>

        <span class="o">}</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>

        <span class="c">/* </span>
<span class="c">            Note: we don&#39;t pass the user config in here yet </span>
<span class="c">            because we only want it executed once, at the lowest </span>
<span class="c">            subclass level.</span>
<span class="c">        */</span> 
    
        <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">init</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_oElement</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">beforeInitEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">Menu</span><span class="o">);</span>

		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;No source element found.  Created element with id: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CSS_CLASS_NAME</span><span class="o">);</span>


        <span class="c">// Subscribe to Custom Events</span>
<span class="c"></span>
        <span class="k">this</span><span class="o">.</span><span class="nx">initEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onInit</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">beforeRenderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onBeforeRender</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onRender</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">beforeShowEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onBeforeShow</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onHide</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">showEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onShow</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">beforeHideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onBeforeHide</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">mouseOverEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onMouseOver</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">mouseOutEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onMouseOut</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">clickEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onClick</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">keyDownEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onKeyDown</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">keyPressEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onKeyPress</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">blurEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onBlur</span><span class="o">);</span>


		<span class="c">//	Fixes an issue in Firefox 2 and Webkit where Dom&#39;s &quot;getX&quot; and &quot;getY&quot; </span>
<span class="c"></span>		<span class="c">//	methods return values that don&#39;t take scrollTop into consideration </span>
<span class="c"></span>
        <span class="k">if</span> <span class="o">((</span><span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&amp;&amp;</span> <span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&lt;</span> <span class="m">1</span><span class="o">.</span><span class="m">9</span><span class="o">)</span> <span class="o">||</span> <span class="nx">UA</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_Y</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onYChange</span><span class="o">);</span>

        <span class="o">}</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">p_oConfig</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">applyConfig</span><span class="o">(</span><span class="nx">p_oConfig</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    
        <span class="o">}</span>


        <span class="c">// Register the Menu instance with the MenuManager</span>
<span class="c"></span>
        <span class="nx">MenuManager</span><span class="o">.</span><span class="nx">addMenu</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
        

        <span class="k">this</span><span class="o">.</span><span class="nx">initEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">Menu</span><span class="o">);</span>

    <span class="o">}</span>

<span class="o">},</span>



<span class="c">// Private methods</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @method _initSubTree</span>
<span class="c">* @description Iterates the childNodes of the source element to find nodes </span>
<span class="c">* used to instantiate menu and menu items.</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_initSubTree</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">,</span>
        <span class="nx">sSrcElementTagName</span><span class="o">,</span>
        <span class="nx">nGroup</span><span class="o">,</span>
        <span class="nx">sGroupTitleTagName</span><span class="o">,</span>
        <span class="nx">oNode</span><span class="o">,</span>
        <span class="nx">aListElements</span><span class="o">,</span>
        <span class="nx">nListElements</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oSrcElement</span><span class="o">)</span> <span class="o">{</span>
    
        <span class="nx">sSrcElementTagName</span> <span class="o">=</span> 
            <span class="o">(</span><span class="nx">oSrcElement</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">());</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">sSrcElementTagName</span> <span class="o">==</span> <span class="nx">_DIV_UPPERCASE</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="c">//  Populate the collection of item groups and item group titles</span>
<span class="c"></span>    
            <span class="nx">oNode</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
    

            <span class="k">if</span> <span class="o">(</span><span class="nx">oNode</span><span class="o">)</span> <span class="o">{</span>
    
                <span class="nx">nGroup</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                <span class="nx">sGroupTitleTagName</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">GROUP_TITLE_TAG_NAME</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">();</span>
        
                <span class="k">do</span> <span class="o">{</span>
        

                    <span class="k">if</span> <span class="o">(</span><span class="nx">oNode</span> <span class="o">&amp;&amp;</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>
        
                        <span class="nx">switch</span> <span class="o">(</span><span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
        
                            <span class="nx">case</span> <span class="nx">sGroupTitleTagName</span><span class="o">:</span>
                            
                                <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">nGroup</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">;</span>
        
                            <span class="k">break</span><span class="o">;</span>
        
                            <span class="nx">case</span> <span class="nx">_UL_UPPERCASE</span><span class="o">:</span>
        
                                <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">nGroup</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">;</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">[</span><span class="nx">nGroup</span><span class="o">]</span> <span class="o">=</span> <span class="o">[];</span>
                                <span class="nx">nGroup</span><span class="o">++;</span>
        
                            <span class="k">break</span><span class="o">;</span>
        
                        <span class="o">}</span>
                    
                    <span class="o">}</span>
        
                <span class="o">}</span>
                <span class="k">while</span> <span class="o">((</span><span class="nx">oNode</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">));</span>
        
        
                <span class="c">/*</span>
<span class="c">                    Apply the &quot;first-of-type&quot; class to the first UL to mimic </span>
<span class="c">                    the &quot;:first-of-type&quot; CSS3 psuedo class.</span>
<span class="c">                */</span>
        
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
        
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>
        
                <span class="o">}</span>
            
            <span class="o">}</span>
    
        <span class="o">}</span>
    
    
        <span class="nx">oNode</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
    
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Searching DOM for items to initialize.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    

        <span class="k">if</span> <span class="o">(</span><span class="nx">sSrcElementTagName</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="nx">switch</span> <span class="o">(</span><span class="nx">sSrcElementTagName</span><span class="o">)</span> <span class="o">{</span>
        
                <span class="nx">case</span> <span class="nx">_DIV_UPPERCASE</span><span class="o">:</span>

                    <span class="nx">aListElements</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">;</span>
                    <span class="nx">nListElements</span> <span class="o">=</span> <span class="nx">aListElements</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
        
                    <span class="k">if</span> <span class="o">(</span><span class="nx">nListElements</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
        
        				<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Found &quot;</span> <span class="o">+</span> <span class="nx">nListElements</span> <span class="o">+</span> <span class="s2">&quot; item groups to initialize.&quot;</span><span class="o">,</span> 
        							<span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        
                        <span class="nx">i</span> <span class="o">=</span> <span class="nx">nListElements</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>
        
                        <span class="k">do</span> <span class="o">{</span>
        
                            <span class="nx">oNode</span> <span class="o">=</span> <span class="nx">aListElements</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">firstChild</span><span class="o">;</span>
            
                            <span class="k">if</span> <span class="o">(</span><span class="nx">oNode</span><span class="o">)</span> <span class="o">{</span>

                                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Scanning &quot;</span> <span class="o">+</span> 
                                    <span class="nx">aListElements</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">childNodes</span><span class="o">.</span><span class="nx">length</span> <span class="o">+</span> 
                                    <span class="s2">&quot; child nodes for items to initialize.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
            
                                <span class="k">do</span> <span class="o">{</span>
                
                                    <span class="k">if</span> <span class="o">(</span><span class="nx">oNode</span> <span class="o">&amp;&amp;</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> 
                                        <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">_LI</span><span class="o">)</span> <span class="o">{</span>
                
                                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Initializing &quot;</span> <span class="o">+</span> 
                                            <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">+</span> <span class="s2">&quot; node.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        
                                        <span class="k">this</span><span class="o">.</span><span class="nx">addItem</span><span class="o">(</span><span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">(</span><span class="nx">oNode</span><span class="o">,</span> 
                                                    <span class="o">{</span> <span class="nx">parent</span><span class="o">:</span> <span class="k">this</span> <span class="o">}),</span> <span class="nx">i</span><span class="o">);</span>
            
                                    <span class="o">}</span>
                        
                                <span class="o">}</span>
                                <span class="k">while</span> <span class="o">((</span><span class="nx">oNode</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">));</span>
                            
                            <span class="o">}</span>
                    
                        <span class="o">}</span>
                        <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>
        
                    <span class="o">}</span>
        
                <span class="k">break</span><span class="o">;</span>
        
                <span class="nx">case</span> <span class="nx">_SELECT</span><span class="o">:</span>
        
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Scanning &quot;</span> <span class="o">+</span>  
                        <span class="nx">oSrcElement</span><span class="o">.</span><span class="nx">childNodes</span><span class="o">.</span><span class="nx">length</span> <span class="o">+</span> 
                        <span class="s2">&quot; child nodes for items to initialize.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        
                    <span class="nx">oNode</span> <span class="o">=</span> <span class="nx">oSrcElement</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
        
                    <span class="k">do</span> <span class="o">{</span>
        
                        <span class="k">if</span> <span class="o">(</span><span class="nx">oNode</span> <span class="o">&amp;&amp;</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>
                        
                            <span class="nx">switch</span> <span class="o">(</span><span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
            
                                <span class="nx">case</span> <span class="nx">_OPTGROUP</span><span class="o">:</span>
                                <span class="nx">case</span> <span class="nx">_OPTION</span><span class="o">:</span>
            
                                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Initializing &quot;</span> <span class="o">+</span>  
                                        <span class="nx">oNode</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">+</span> <span class="s2">&quot; node.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
            
                                    <span class="k">this</span><span class="o">.</span><span class="nx">addItem</span><span class="o">(</span>
                                            <span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">(</span>
                                                    <span class="nx">oNode</span><span class="o">,</span> 
                                                    <span class="o">{</span> <span class="nx">parent</span><span class="o">:</span> <span class="k">this</span> <span class="o">}</span>
                                                <span class="o">)</span>
                                            <span class="o">);</span>
            
                                <span class="k">break</span><span class="o">;</span>
            
                            <span class="o">}</span>
    
                        <span class="o">}</span>
        
                    <span class="o">}</span>
                    <span class="k">while</span> <span class="o">((</span><span class="nx">oNode</span> <span class="o">=</span> <span class="nx">oNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">));</span>
        
                <span class="k">break</span><span class="o">;</span>
        
            <span class="o">}</span>
    
        <span class="o">}</span>    
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _getFirstEnabledItem</span>
<span class="c">* @description Returns the first enabled item in the menu.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_getFirstEnabledItem</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">aItems</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">(),</span>
        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">returnVal</span><span class="o">;</span>
    

    <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nItems</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>

        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">!=</span> <span class="nx">_NONE</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">;</span>
            <span class="k">break</span><span class="o">;</span>

        <span class="o">}</span>
    
    <span class="o">}</span>
    
    <span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _addItemToGroup</span>
<span class="c">* @description Adds a menu item to a group.</span>
<span class="c">* @private</span>
<span class="c">* @param {Number} p_nGroupIndex Number indicating the group to which the </span>
<span class="c">* item belongs.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem </span>
<span class="c">* instance to be added to the menu.</span>
<span class="c">* @param {String} p_oItem String specifying the text of the item to be added </span>
<span class="c">* to the menu.</span>
<span class="c">* @param {Object} p_oItem Object literal containing a set of menu item </span>
<span class="c">* configuration properties.</span>
<span class="c">* @param {Number} p_nItemIndex Optional. Number indicating the index at </span>
<span class="c">* which the menu item should be added.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>
<span class="nx">_addItemToGroup</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">,</span> <span class="nx">p_nItemIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">nGroupIndex</span><span class="o">,</span>
        <span class="nx">aGroup</span><span class="o">,</span>
        <span class="nx">oGroupItem</span><span class="o">,</span>
        <span class="nx">bAppend</span><span class="o">,</span>
        <span class="nx">oNextItemSibling</span><span class="o">,</span>
        <span class="nx">nItemIndex</span><span class="o">,</span>
        <span class="nx">returnVal</span><span class="o">;</span>


    <span class="k">function</span> <span class="nx">getNextItemSibling</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="nx">p_nStartIndex</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">return</span> <span class="o">(</span><span class="nx">p_aArray</span><span class="o">[</span><span class="nx">p_nStartIndex</span><span class="o">]</span> <span class="o">||</span> <span class="nx">getNextItemSibling</span><span class="o">(</span><span class="nx">p_aArray</span><span class="o">,</span> <span class="o">(</span><span class="nx">p_nStartIndex</span><span class="o">+</span><span class="m">1</span><span class="o">)));</span>

    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">p_oItem</span> <span class="k">instanceof</span> <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_oItem</span><span class="o">;</span>
        <span class="nx">oItem</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">p_oItem</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">oItem</span> <span class="o">=</span> <span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">(</span><span class="nx">p_oItem</span><span class="o">,</span> <span class="o">{</span> <span class="nx">parent</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
    
    <span class="o">}</span>
    <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">p_oItem</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">p_oItem</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

        <span class="nx">oItem</span> <span class="o">=</span> <span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">(</span><span class="nx">p_oItem</span><span class="o">.</span><span class="nx">text</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">);</span>

    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">))</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">;</span>
        
        <span class="o">}</span>


        <span class="nx">nGroupIndex</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">?</span> <span class="nx">p_nGroupIndex</span> <span class="o">:</span> <span class="m">0</span><span class="o">;</span>
        <span class="nx">aGroup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getItemGroup</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">);</span>



        <span class="k">if</span> <span class="o">(!</span><span class="nx">aGroup</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">aGroup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_createItemGroup</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">);</span>

        <span class="o">}</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_nItemIndex</span><span class="o">))</span> <span class="o">{</span>

            <span class="nx">bAppend</span> <span class="o">=</span> <span class="o">(</span><span class="nx">p_nItemIndex</span> <span class="o">&gt;=</span> <span class="nx">aGroup</span><span class="o">.</span><span class="nx">length</span><span class="o">);</span>            


            <span class="k">if</span> <span class="o">(</span><span class="nx">aGroup</span><span class="o">[</span><span class="nx">p_nItemIndex</span><span class="o">])</span> <span class="o">{</span>
    
                <span class="nx">aGroup</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">p_nItemIndex</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="nx">oItem</span><span class="o">);</span>
    
            <span class="o">}</span>
            <span class="k">else</span> <span class="o">{</span>
    
                <span class="nx">aGroup</span><span class="o">[</span><span class="nx">p_nItemIndex</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">;</span>
    
            <span class="o">}</span>


            <span class="nx">oGroupItem</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">[</span><span class="nx">p_nItemIndex</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oGroupItem</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">bAppend</span> <span class="o">&amp;&amp;</span> <span class="o">(!</span><span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">parentNode</span> <span class="o">||</span> 
                        <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">11</span><span class="o">))</span> <span class="o">{</span>
        
                    <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">].</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>
    
                <span class="o">}</span>
                <span class="k">else</span> <span class="o">{</span>
    
                    <span class="nx">oNextItemSibling</span> <span class="o">=</span> <span class="nx">getNextItemSibling</span><span class="o">(</span><span class="nx">aGroup</span><span class="o">,</span> <span class="o">(</span><span class="nx">p_nItemIndex</span><span class="o">+</span><span class="m">1</span><span class="o">));</span>
    
                    <span class="k">if</span> <span class="o">(</span><span class="nx">oNextItemSibling</span> <span class="o">&amp;&amp;</span> <span class="o">(!</span><span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">parentNode</span> <span class="o">||</span> 
                            <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">11</span><span class="o">))</span> <span class="o">{</span>
            
                        <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">].</span><span class="nx">insertBefore</span><span class="o">(</span>
                                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oNextItemSibling</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>
        
                    <span class="o">}</span>
    
                <span class="o">}</span>
    

                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
        
                <span class="k">this</span><span class="o">.</span><span class="nx">_subscribeToItemEvents</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">);</span>
    
                <span class="k">this</span><span class="o">.</span><span class="nx">_configureSubmenu</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">);</span>
                
                <span class="k">this</span><span class="o">.</span><span class="nx">_updateItemProperties</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">);</span>
        
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Item inserted.&quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot; Text: &quot;</span> <span class="o">+</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">)</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot; Index: &quot;</span> <span class="o">+</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot; Group Index: &quot;</span> <span class="o">+</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">itemAddedEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">changeContentEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>

                <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">oGroupItem</span><span class="o">;</span>
    
            <span class="o">}</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>
    
            <span class="nx">nItemIndex</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
    
            <span class="nx">aGroup</span><span class="o">[</span><span class="nx">nItemIndex</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">;</span>

            <span class="nx">oGroupItem</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">[</span><span class="nx">nItemIndex</span><span class="o">];</span>
    

            <span class="k">if</span> <span class="o">(</span><span class="nx">oGroupItem</span><span class="o">)</span> <span class="o">{</span>
    
                <span class="k">if</span> <span class="o">(!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">],</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">))</span> <span class="o">{</span>
    
                    <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">].</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>
    
                <span class="o">}</span>
    
                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="nx">_GROUP_INDEX</span><span class="o">,</span> <span class="nx">nGroupIndex</span><span class="o">);</span>
                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="nx">_INDEX</span><span class="o">,</span> <span class="nx">nItemIndex</span><span class="o">);</span>
        
                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
    
                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">index</span> <span class="o">=</span> <span class="nx">nItemIndex</span><span class="o">;</span>
                <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">groupIndex</span> <span class="o">=</span> <span class="nx">nGroupIndex</span><span class="o">;</span>
        
                <span class="k">this</span><span class="o">.</span><span class="nx">_subscribeToItemEvents</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">);</span>
    
                <span class="k">this</span><span class="o">.</span><span class="nx">_configureSubmenu</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">);</span>
    
                <span class="k">if</span> <span class="o">(</span><span class="nx">nItemIndex</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
        
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>
        
                <span class="o">}</span>

                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Item added.&quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot; Text: &quot;</span> <span class="o">+</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">)</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot; Index: &quot;</span> <span class="o">+</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot; Group Index: &quot;</span> <span class="o">+</span> <span class="nx">oGroupItem</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        

                <span class="k">this</span><span class="o">.</span><span class="nx">itemAddedEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">oGroupItem</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">changeContentEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>

                <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">oGroupItem</span><span class="o">;</span>
    
            <span class="o">}</span>
    
        <span class="o">}</span>

    <span class="o">}</span>
    
    <span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _removeItemFromGroupByIndex</span>
<span class="c">* @description Removes a menu item from a group by index.  Returns the menu </span>
<span class="c">* item that was removed.</span>
<span class="c">* @private</span>
<span class="c">* @param {Number} p_nGroupIndex Number indicating the group to which the menu </span>
<span class="c">* item belongs.</span>
<span class="c">* @param {Number} p_nItemIndex Number indicating the index of the menu item </span>
<span class="c">* to be removed.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>
<span class="nx">_removeItemFromGroupByIndex</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_nItemIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nGroupIndex</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">?</span> <span class="nx">p_nGroupIndex</span> <span class="o">:</span> <span class="m">0</span><span class="o">,</span>
        <span class="nx">aGroup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getItemGroup</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">),</span>
        <span class="nx">aArray</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">oUL</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">aGroup</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">aArray</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">p_nItemIndex</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">aArray</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
    
        <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="c">// Update the index and className properties of each member        </span>
<span class="c"></span>            
            <span class="k">this</span><span class="o">.</span><span class="nx">_updateItemProperties</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">);</span>
    
            <span class="k">if</span> <span class="o">(</span><span class="nx">aGroup</span><span class="o">.</span><span class="nx">length</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
    
                <span class="c">// Remove the UL</span>
<span class="c"></span>    
                <span class="nx">oUL</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">];</span>
    
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">body</span> <span class="o">&amp;&amp;</span> <span class="nx">oUL</span><span class="o">)</span> <span class="o">{</span>
    
                    <span class="k">this</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oUL</span><span class="o">);</span>
    
                <span class="o">}</span>
    
                <span class="c">// Remove the group from the array of items</span>
<span class="c"></span>    
                <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
    
    
                <span class="c">// Remove the UL from the array of ULs</span>
<span class="c"></span>    
                <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">nGroupIndex</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
    
    
                <span class="c">/*</span>
<span class="c">                     Assign the &quot;first-of-type&quot; class to the new first UL </span>
<span class="c">                     in the collection</span>
<span class="c">                */</span>
    
                <span class="nx">oUL</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
    
                <span class="k">if</span> <span class="o">(</span><span class="nx">oUL</span><span class="o">)</span> <span class="o">{</span>
    
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oUL</span><span class="o">,</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>
    
                <span class="o">}</span>            
    
            <span class="o">}</span>
    

            <span class="k">this</span><span class="o">.</span><span class="nx">itemRemovedEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">oItem</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">changeContentEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
    
        <span class="o">}</span>

    <span class="o">}</span>

	<span class="c">// Return a reference to the item that was removed</span>
<span class="c"></span>
	<span class="k">return</span> <span class="nx">oItem</span><span class="o">;</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _removeItemFromGroupByValue</span>
<span class="c">* @description Removes a menu item from a group by reference.  Returns the </span>
<span class="c">* menu item that was removed.</span>
<span class="c">* @private</span>
<span class="c">* @param {Number} p_nGroupIndex Number indicating the group to which the</span>
<span class="c">* menu item belongs.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem </span>
<span class="c">* instance to be removed.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>    
<span class="nx">_removeItemFromGroupByValue</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">aGroup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getItemGroup</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">),</span>
        <span class="nx">nItems</span><span class="o">,</span>
        <span class="nx">nItemIndex</span><span class="o">,</span>
        <span class="nx">returnVal</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">aGroup</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
        <span class="nx">nItemIndex</span> <span class="o">=</span> <span class="o">-</span><span class="m">1</span><span class="o">;</span>
    
        <span class="k">if</span> <span class="o">(</span><span class="nx">nItems</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="nx">i</span> <span class="o">=</span> <span class="nx">nItems</span><span class="o">-</span><span class="m">1</span><span class="o">;</span>
        
            <span class="k">do</span> <span class="o">{</span>
        
                <span class="k">if</span> <span class="o">(</span><span class="nx">aGroup</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">==</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>
        
                    <span class="nx">nItemIndex</span> <span class="o">=</span> <span class="nx">i</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>    
        
                <span class="o">}</span>
        
            <span class="o">}</span>
            <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>
        
            <span class="k">if</span> <span class="o">(</span><span class="nx">nItemIndex</span> <span class="o">&gt;</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
        
                <span class="nx">returnVal</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_removeItemFromGroupByIndex</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">nItemIndex</span><span class="o">);</span>
        
            <span class="o">}</span>
    
        <span class="o">}</span>
    
    <span class="o">}</span>
    
    <span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _updateItemProperties</span>
<span class="c">* @description Updates the &quot;index,&quot; &quot;groupindex,&quot; and &quot;className&quot; properties </span>
<span class="c">* of the menu items in the specified group. </span>
<span class="c">* @private</span>
<span class="c">* @param {Number} p_nGroupIndex Number indicating the group of items to update.</span>
<span class="c">*/</span>
<span class="nx">_updateItemProperties</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">aGroup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getItemGroup</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">),</span>
        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">.</span><span class="nx">length</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">oLI</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">nItems</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">i</span> <span class="o">=</span> <span class="nx">nItems</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>

        <span class="c">// Update the index and className properties of each member</span>
<span class="c"></span>    
        <span class="k">do</span> <span class="o">{</span>

            <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>
    
                <span class="nx">oLI</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>

                <span class="nx">oItem</span><span class="o">.</span><span class="nx">index</span> <span class="o">=</span> <span class="nx">i</span><span class="o">;</span>
                <span class="nx">oItem</span><span class="o">.</span><span class="nx">groupIndex</span> <span class="o">=</span> <span class="nx">p_nGroupIndex</span><span class="o">;</span>

                <span class="nx">oLI</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="nx">_GROUP_INDEX</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">);</span>
                <span class="nx">oLI</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="nx">_INDEX</span><span class="o">,</span> <span class="nx">i</span><span class="o">);</span>

                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">oLI</span><span class="o">,</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>

            <span class="o">}</span>
    
        <span class="o">}</span>
        <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">oLI</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oLI</span><span class="o">,</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>

        <span class="o">}</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _createItemGroup</span>
<span class="c">* @description Creates a new menu item group (array) and its associated </span>
<span class="c">* &lt;code&gt;&amp;#60;ul&amp;#62;&lt;/code&gt; element. Returns an aray of menu item groups.</span>
<span class="c">* @private</span>
<span class="c">* @param {Number} p_nIndex Number indicating the group to create.</span>
<span class="c">* @return {Array}</span>
<span class="c">*/</span>
<span class="nx">_createItemGroup</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oUL</span><span class="o">,</span>
    	<span class="nx">returnVal</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">[</span><span class="nx">p_nIndex</span><span class="o">])</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">[</span><span class="nx">p_nIndex</span><span class="o">]</span> <span class="o">=</span> <span class="o">[];</span>

        <span class="nx">oUL</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="nx">_UL_LOWERCASE</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">p_nIndex</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oUL</span><span class="o">;</span>

        <span class="nx">returnVal</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">[</span><span class="nx">p_nIndex</span><span class="o">];</span>

    <span class="o">}</span>
    
    <span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _getItemGroup</span>
<span class="c">* @description Returns the menu item group at the specified index.</span>
<span class="c">* @private</span>
<span class="c">* @param {Number} p_nIndex Number indicating the index of the menu item group </span>
<span class="c">* to be retrieved.</span>
<span class="c">* @return {Array}</span>
<span class="c">*/</span>
<span class="nx">_getItemGroup</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nIndex</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_nIndex</span><span class="o">)</span> <span class="o">?</span> <span class="nx">p_nIndex</span> <span class="o">:</span> <span class="m">0</span><span class="o">,</span>
    	<span class="nx">aGroups</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">,</span>
    	<span class="nx">returnVal</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">nIndex</span> <span class="k">in</span> <span class="nx">aGroups</span><span class="o">)</span> <span class="o">{</span>

	    <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">aGroups</span><span class="o">[</span><span class="nx">nIndex</span><span class="o">];</span>

	<span class="o">}</span>
	
	<span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _configureSubmenu</span>
<span class="c">* @description Subscribes the menu item&#39;s submenu to its parent menu&#39;s events.</span>
<span class="c">* @private</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem </span>
<span class="c">* instance with the submenu to be configured.</span>
<span class="c">*/</span>
<span class="nx">_configureSubmenu</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">p_oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
            
        <span class="c">/*</span>
<span class="c">            Listen for configuration changes to the parent menu </span>
<span class="c">            so they they can be applied to the submenu.</span>
<span class="c">        */</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">configChangedEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onParentMenuConfigChange</span><span class="o">,</span> <span class="nx">oSubmenu</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onParentMenuRender</span><span class="o">,</span> <span class="nx">oSubmenu</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

    <span class="o">}</span>

<span class="o">},</span>




<span class="c">/**</span>
<span class="c">* @method _subscribeToItemEvents</span>
<span class="c">* @description Subscribes a menu to a menu item&#39;s event.</span>
<span class="c">* @private</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem </span>
<span class="c">* instance whose events should be subscribed to.</span>
<span class="c">*/</span>
<span class="nx">_subscribeToItemEvents</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>

    <span class="nx">p_oItem</span><span class="o">.</span><span class="nx">destroyEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onMenuItemDestroy</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
    <span class="nx">p_oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">configChangedEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onMenuItemConfigChange</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onVisibleChange</span>
<span class="c">* @description Change event handler for the the menu&#39;s &quot;visible&quot; configuration</span>
<span class="c">* property.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onVisibleChange</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">bVisible</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
    
    <span class="k">if</span> <span class="o">(</span><span class="nx">bVisible</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_VISIBLE</span><span class="o">);</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_VISIBLE</span><span class="o">);</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _cancelHideDelay</span>
<span class="c">* @description Cancels the call to &quot;hideMenu.&quot;</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_cancelHideDelay</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oTimer</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">().</span><span class="nx">_hideDelayTimer</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">oTimer</span><span class="o">)</span> <span class="o">{</span>

		<span class="nx">oTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _execHideDelay</span>
<span class="c">* @description Hides the menu after the number of milliseconds specified by </span>
<span class="c">* the &quot;hidedelay&quot; configuration property.</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_execHideDelay</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">_cancelHideDelay</span><span class="o">();</span>

    <span class="k">var</span> <span class="nx">oRoot</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">();</span>
        
	<span class="nx">oRoot</span><span class="o">.</span><span class="nx">_hideDelayTimer</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="nx">oRoot</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_HIDE_DELAY</span><span class="o">),</span> <span class="k">this</span><span class="o">,</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
    
        <span class="k">if</span> <span class="o">(</span><span class="nx">oRoot</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">)</span> <span class="o">{</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">oRoot</span><span class="o">.</span><span class="nx">hasFocus</span><span class="o">())</span> <span class="o">{</span>

				<span class="nx">oRoot</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
			
			<span class="o">}</span>
			
            <span class="nx">oRoot</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">();</span>

        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oRoot</span> <span class="o">==</span> <span class="k">this</span> <span class="o">&amp;&amp;</span> <span class="o">!(</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">)</span> <span class="o">&amp;&amp;</span> 
            <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>
        
        <span class="o">}</span>
    
    <span class="o">});</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _cancelShowDelay</span>
<span class="c">* @description Cancels the call to the &quot;showMenu.&quot;</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_cancelShowDelay</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oTimer</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">().</span><span class="nx">_showDelayTimer</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">oTimer</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _execSubmenuHideDelay</span>
<span class="c">* @description Hides a submenu after the number of milliseconds specified by </span>
<span class="c">* the &quot;submenuhidedelay&quot; configuration property have ellapsed.</span>
<span class="c">* @private</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oSubmenu Object specifying the submenu that  </span>
<span class="c">* should be hidden.</span>
<span class="c">* @param {Number} p_nMouseX The x coordinate of the mouse when it left </span>
<span class="c">* the specified submenu&#39;s parent menu item.</span>
<span class="c">* @param {Number} p_nHideDelay The number of milliseconds that should ellapse</span>
<span class="c">* before the submenu is hidden.</span>
<span class="c">*/</span>
<span class="nx">_execSubmenuHideDelay</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oSubmenu</span><span class="o">,</span> <span class="nx">p_nMouseX</span><span class="o">,</span> <span class="nx">p_nHideDelay</span><span class="o">)</span> <span class="o">{</span>

	<span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">_submenuHideDelayTimer</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="m">50</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nCurrentMouseX</span> <span class="o">&gt;</span> <span class="o">(</span><span class="nx">p_nMouseX</span> <span class="o">+</span> <span class="m">10</span><span class="o">))</span> <span class="o">{</span>

            <span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">_submenuHideDelayTimer</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="nx">p_nHideDelay</span><span class="o">,</span> <span class="nx">p_oSubmenu</span><span class="o">,</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
        
                <span class="k">this</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>

            <span class="o">});</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>
        
        <span class="o">}</span>
	
	<span class="o">});</span>

<span class="o">},</span>



<span class="c">// Protected methods</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @method _disableScrollHeader</span>
<span class="c">* @description Disables the header used for scrolling the body of the menu.</span>
<span class="c">* @protected</span>
<span class="c">*/</span>
<span class="nx">_disableScrollHeader</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bHeaderDisabled</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">header</span><span class="o">,</span> <span class="nx">_TOP_SCROLLBAR_DISABLED</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_bHeaderDisabled</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _disableScrollFooter</span>
<span class="c">* @description Disables the footer used for scrolling the body of the menu.</span>
<span class="c">* @protected</span>
<span class="c">*/</span>
<span class="nx">_disableScrollFooter</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bFooterDisabled</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">footer</span><span class="o">,</span> <span class="nx">_BOTTOM_SCROLLBAR_DISABLED</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_bFooterDisabled</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _enableScrollHeader</span>
<span class="c">* @description Enables the header used for scrolling the body of the menu.</span>
<span class="c">* @protected</span>
<span class="c">*/</span>
<span class="nx">_enableScrollHeader</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_bHeaderDisabled</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">header</span><span class="o">,</span> <span class="nx">_TOP_SCROLLBAR_DISABLED</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_bHeaderDisabled</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _enableScrollFooter</span>
<span class="c">* @description Enables the footer used for scrolling the body of the menu.</span>
<span class="c">* @protected</span>
<span class="c">*/</span>
<span class="nx">_enableScrollFooter</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_bFooterDisabled</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">footer</span><span class="o">,</span> <span class="nx">_BOTTOM_SCROLLBAR_DISABLED</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_bFooterDisabled</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onMouseOver</span>
<span class="c">* @description &quot;mouseover&quot; event handler for the menu.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onMouseOver</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">1</span><span class="o">],</span>
        <span class="nx">oTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">),</span>
        <span class="nx">oRoot</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">(),</span>
        <span class="nx">oSubmenuHideDelayTimer</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_submenuHideDelayTimer</span><span class="o">,</span>
        <span class="nx">oParentMenu</span><span class="o">,</span>
        <span class="nx">nShowDelay</span><span class="o">,</span>
        <span class="nx">bShowDelay</span><span class="o">,</span>
        <span class="nx">oActiveItem</span><span class="o">,</span>
        <span class="nx">oItemCfg</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">;</span>


    <span class="k">var</span> <span class="nx">showSubmenu</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">))</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">show</span><span class="o">();</span>

        <span class="o">}</span>

    <span class="o">};</span>


    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bStopMouseEventHandlers</span><span class="o">)</span> <span class="o">{</span>
    
		<span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bHandledMouseOverEvent</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">oTarget</span> <span class="o">==</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span> <span class="o">||</span> 
				<span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oTarget</span><span class="o">)))</span> <span class="o">{</span>
	
			<span class="c">// Menu mouseover logic</span>
<span class="c"></span>
	        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_useHideDelay</span><span class="o">)</span> <span class="o">{</span>
	        	<span class="k">this</span><span class="o">.</span><span class="nx">_cancelHideDelay</span><span class="o">();</span>
	        <span class="o">}</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">_nCurrentMouseX</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
	
			<span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_MOUSEMOVE</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onMouseMove</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>


			<span class="c">/*</span>
<span class="c">				If the mouse is moving from the submenu back to its corresponding menu item, </span>
<span class="c">				don&#39;t hide the submenu or clear the active MenuItem.</span>
<span class="c">			*/</span>

			<span class="k">if</span> <span class="o">(!(</span><span class="nx">oItem</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getRelatedTarget</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">))))</span> <span class="o">{</span>

				<span class="k">this</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">();</span>

			<span class="o">}</span>
	

			<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">&amp;&amp;</span> <span class="nx">oSubmenuHideDelayTimer</span><span class="o">)</span> <span class="o">{</span>
	
				<span class="nx">oSubmenuHideDelayTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>
	
				<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	
				<span class="nx">oParentMenu</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
	
				<span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">_bHandledMouseOutEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
				<span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">_bHandledMouseOverEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
	
			<span class="o">}</span>
	
	
			<span class="k">this</span><span class="o">.</span><span class="nx">_bHandledMouseOverEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">_bHandledMouseOutEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
		
		<span class="o">}</span>
	
	
		<span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">handledMouseOverEvent</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">)</span> <span class="o">&amp;&amp;</span> 
			<span class="o">(</span><span class="nx">oTarget</span> <span class="o">==</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span> <span class="o">||</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oTarget</span><span class="o">)))</span> <span class="o">{</span>
	
			<span class="c">// Menu Item mouseover logic</span>
<span class="c"></span>	
			<span class="nx">nShowDelay</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SHOW_DELAY</span><span class="o">);</span>
			<span class="nx">bShowDelay</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nShowDelay</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">);</span>
	
	
			<span class="k">if</span> <span class="o">(</span><span class="nx">bShowDelay</span><span class="o">)</span> <span class="o">{</span>
			
				<span class="k">this</span><span class="o">.</span><span class="nx">_cancelShowDelay</span><span class="o">();</span>
			
			<span class="o">}</span>
	
	
			<span class="nx">oActiveItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">;</span>
		
			<span class="k">if</span> <span class="o">(</span><span class="nx">oActiveItem</span><span class="o">)</span> <span class="o">{</span>
		
				<span class="nx">oActiveItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
		
			<span class="o">}</span>
	
	
			<span class="nx">oItemCfg</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>
		
			<span class="c">// Select and focus the current menu item</span>
<span class="c"></span>		
			<span class="nx">oItemCfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	
	
			<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">hasFocus</span><span class="o">()</span> <span class="o">||</span> <span class="nx">oRoot</span><span class="o">.</span><span class="nx">_hasFocus</span><span class="o">)</span> <span class="o">{</span>
			
				<span class="nx">oItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
				
				<span class="nx">oRoot</span><span class="o">.</span><span class="nx">_hasFocus</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
			
			<span class="o">}</span>
	
	
			<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_AUTO_SUBMENU_DISPLAY</span><span class="o">))</span> <span class="o">{</span>
	
				<span class="c">// Show the submenu this menu item</span>
<span class="c"></span>	
				<span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItemCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
			
				<span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
			
					<span class="k">if</span> <span class="o">(</span><span class="nx">bShowDelay</span><span class="o">)</span> <span class="o">{</span>
	
						<span class="nx">oRoot</span><span class="o">.</span><span class="nx">_showDelayTimer</span> <span class="o">=</span> 
							<span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="nx">oRoot</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SHOW_DELAY</span><span class="o">),</span> <span class="nx">oSubmenu</span><span class="o">,</span> <span class="nx">showSubmenu</span><span class="o">);</span>
			
					<span class="o">}</span>
					<span class="k">else</span> <span class="o">{</span>
	
						<span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">show</span><span class="o">();</span>
	
					<span class="o">}</span>
	
				<span class="o">}</span>
	
			<span class="o">}</span>                        
	
			<span class="nx">oItem</span><span class="o">.</span><span class="nx">handledMouseOverEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
			<span class="nx">oItem</span><span class="o">.</span><span class="nx">handledMouseOutEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
	
		<span class="o">}</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onMouseOut</span>
<span class="c">* @description &quot;mouseout&quot; event handler for the menu.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onMouseOut</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">1</span><span class="o">],</span>
        <span class="nx">oRelatedTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getRelatedTarget</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">),</span>
        <span class="nx">bMovingToSubmenu</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
        <span class="nx">oItemCfg</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">,</span>
        <span class="nx">nSubmenuHideDelay</span><span class="o">,</span>
        <span class="nx">nShowDelay</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bStopMouseEventHandlers</span><span class="o">)</span> <span class="o">{</span>
    
		<span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">))</span> <span class="o">{</span>
	
			<span class="nx">oItemCfg</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>
			<span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItemCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
	
	
			<span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">oRelatedTarget</span> <span class="o">==</span> <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">element</span> <span class="o">||</span>
					<span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oRelatedTarget</span><span class="o">)))</span> <span class="o">{</span>
	
				<span class="nx">bMovingToSubmenu</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
	
			<span class="o">}</span>
	
	
			<span class="k">if</span> <span class="o">(!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">handledMouseOutEvent</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="nx">oRelatedTarget</span> <span class="o">!=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span> <span class="o">&amp;&amp;</span>  
				<span class="o">!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oRelatedTarget</span><span class="o">))</span> <span class="o">||</span> <span class="nx">bMovingToSubmenu</span><span class="o">))</span> <span class="o">{</span>
	
				<span class="c">// Menu Item mouseout logic</span>
<span class="c"></span>	
				<span class="k">if</span> <span class="o">(!</span><span class="nx">bMovingToSubmenu</span><span class="o">)</span> <span class="o">{</span>
	
					<span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
	
	
					<span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
	
						<span class="nx">nSubmenuHideDelay</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU_HIDE_DELAY</span><span class="o">);</span>
	
						<span class="nx">nShowDelay</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SHOW_DELAY</span><span class="o">);</span>
	
						<span class="k">if</span> <span class="o">(!(</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">nSubmenuHideDelay</span> <span class="o">&gt;</span> <span class="m">0</span> <span class="o">&amp;&amp;</span> 
							<span class="nx">nShowDelay</span> <span class="o">&gt;=</span> <span class="nx">nSubmenuHideDelay</span><span class="o">)</span> <span class="o">{</span>
	
							<span class="k">this</span><span class="o">.</span><span class="nx">_execSubmenuHideDelay</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">,</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageX</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">),</span>
									<span class="nx">nSubmenuHideDelay</span><span class="o">);</span>
	
						<span class="o">}</span>
						<span class="k">else</span> <span class="o">{</span>
	
							<span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>
	
						<span class="o">}</span>
	
					<span class="o">}</span>
	
				<span class="o">}</span>
	
	
				<span class="nx">oItem</span><span class="o">.</span><span class="nx">handledMouseOutEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
				<span class="nx">oItem</span><span class="o">.</span><span class="nx">handledMouseOverEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
		
			<span class="o">}</span>
	
		<span class="o">}</span>


		<span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bHandledMouseOutEvent</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="nx">oRelatedTarget</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span> <span class="o">&amp;&amp;</span>  
			<span class="o">!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oRelatedTarget</span><span class="o">))</span> <span class="o">||</span> <span class="nx">bMovingToSubmenu</span><span class="o">))</span> <span class="o">{</span>
	
			<span class="c">// Menu mouseout logic</span>
<span class="c"></span>
	        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_useHideDelay</span><span class="o">)</span> <span class="o">{</span>
	        	<span class="k">this</span><span class="o">.</span><span class="nx">_execHideDelay</span><span class="o">();</span>
	        <span class="o">}</span>

			<span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_MOUSEMOVE</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onMouseMove</span><span class="o">);</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">_nCurrentMouseX</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageX</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">_bHandledMouseOutEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">_bHandledMouseOverEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
	
		<span class="o">}</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onMouseMove</span>
<span class="c">* @description &quot;click&quot; event handler for the menu.</span>
<span class="c">* @protected</span>
<span class="c">* @param {Event} p_oEvent Object representing the DOM event object passed </span>
<span class="c">* back by the event utility (YAHOO.util.Event).</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">_onMouseMove</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oEvent</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_bStopMouseEventHandlers</span><span class="o">)</span> <span class="o">{</span>
    
	    <span class="k">this</span><span class="o">.</span><span class="nx">_nCurrentMouseX</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getPageX</span><span class="o">(</span><span class="nx">p_oEvent</span><span class="o">);</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onClick</span>
<span class="c">* @description &quot;click&quot; event handler for the menu.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onClick</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
		<span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">1</span><span class="o">],</span>
		<span class="nx">bInMenuAnchor</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
		<span class="nx">oSubmenu</span><span class="o">,</span>
		<span class="nx">oMenu</span><span class="o">,</span>
		<span class="nx">oRoot</span><span class="o">,</span>
		<span class="nx">sId</span><span class="o">,</span>
		<span class="nx">sURL</span><span class="o">,</span>
		<span class="nx">nHashPos</span><span class="o">,</span>
		<span class="nx">nLen</span><span class="o">;</span>


	<span class="k">var</span> <span class="nx">hide</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

		<span class="c">/*</span>
<span class="c">			There is an inconsistency between Firefox for Mac OS X and Firefox Windows </span>
<span class="c">			regarding the triggering of the display of the browser&#39;s context menu and the </span>
<span class="c">			subsequent firing of the &quot;click&quot; event. In Firefox for Windows, when the user </span>
<span class="c">			triggers the display of the browser&#39;s context menu the &quot;click&quot; event also fires </span>
<span class="c">			for the document object, even though the &quot;click&quot; event did not fire for the </span>
<span class="c">			element that was the original target of the &quot;contextmenu&quot; event. This is unique </span>
<span class="c">			to Firefox on Windows. For all other A-Grade browsers, including Firefox for </span>
<span class="c">			Mac OS X, the &quot;click&quot; event doesn&#39;t fire for the document object. </span>
<span class="c"></span>
<span class="c">			This bug in Firefox for Windows affects Menu as Menu instances listen for </span>
<span class="c">			events at the document level and have an internal &quot;click&quot; event handler they </span>
<span class="c">			use to hide themselves when clicked. As a result, in Firefox for Windows a </span>
<span class="c">			Menu will hide when the user right clicks on a MenuItem to raise the browser&#39;s </span>
<span class="c">			default context menu, because its internal &quot;click&quot; event handler ends up </span>
<span class="c">			getting called.  The following line fixes this bug.</span>
<span class="c">		*/</span>

		<span class="k">if</span> <span class="o">(!((</span><span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">platform</span> <span class="o">==</span> <span class="nx">_WINDOWS</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oEvent</span><span class="o">.</span><span class="nx">button</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">))</span> <span class="o">{</span>
		
			<span class="nx">oRoot</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">();</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">oRoot</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span> <span class="o">||</span> 
				<span class="nx">oRoot</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_STATIC</span><span class="o">)</span> <span class="o">{</span>

				<span class="nx">oRoot</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">();</span>

			<span class="o">}</span>
			<span class="k">else</span> <span class="o">{</span>

				<span class="nx">oRoot</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>
			
			<span class="o">}</span>
		
		<span class="o">}</span>	
	
	<span class="o">};</span>


	<span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>
	
		<span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">))</span> <span class="o">{</span>
		
			<span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>

			<span class="nx">hide</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>

		<span class="o">}</span>
		<span class="k">else</span> <span class="o">{</span>

			<span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
	
			
			<span class="c">/*</span>
<span class="c">				 Check if the URL of the anchor is pointing to an element that is </span>
<span class="c">				 a child of the menu.</span>
<span class="c">			*/</span>
			
			<span class="nx">sURL</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_URL</span><span class="o">);</span>

		
			<span class="k">if</span> <span class="o">(</span><span class="nx">sURL</span><span class="o">)</span> <span class="o">{</span>
	
				<span class="nx">nHashPos</span> <span class="o">=</span> <span class="nx">sURL</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="nx">_HASH</span><span class="o">);</span>
	
				<span class="nx">nLen</span> <span class="o">=</span> <span class="nx">sURL</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
	
	
				<span class="k">if</span> <span class="o">(</span><span class="nx">nHashPos</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
	
					<span class="nx">sURL</span> <span class="o">=</span> <span class="nx">sURL</span><span class="o">.</span><span class="nx">substr</span><span class="o">(</span><span class="nx">nHashPos</span><span class="o">,</span> <span class="nx">nLen</span><span class="o">);</span>
		
					<span class="nx">nLen</span> <span class="o">=</span> <span class="nx">sURL</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
	
	
					<span class="k">if</span> <span class="o">(</span><span class="nx">nLen</span> <span class="o">&gt;</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
	
						<span class="nx">sId</span> <span class="o">=</span> <span class="nx">sURL</span><span class="o">.</span><span class="nx">substr</span><span class="o">(</span><span class="m">1</span><span class="o">,</span> <span class="nx">nLen</span><span class="o">);</span>
	
						<span class="nx">oMenu</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuManager</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">(</span><span class="nx">sId</span><span class="o">);</span>
						
						<span class="k">if</span> <span class="o">(</span><span class="nx">oMenu</span><span class="o">)</span> <span class="o">{</span>

							<span class="nx">bInMenuAnchor</span> <span class="o">=</span> 
								<span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">()</span> <span class="o">===</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">());</span>

						<span class="o">}</span>
						
					<span class="o">}</span>
					<span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">nLen</span> <span class="o">===</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
	
						<span class="nx">bInMenuAnchor</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
					
					<span class="o">}</span>
	
				<span class="o">}</span>
			
			<span class="o">}</span>

	
			<span class="k">if</span> <span class="o">(</span><span class="nx">bInMenuAnchor</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_TARGET</span><span class="o">))</span> <span class="o">{</span>
	
				<span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>
				

				<span class="k">if</span> <span class="o">(</span><span class="nx">UA</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
				
					<span class="nx">oItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
				
				<span class="o">}</span>
				<span class="k">else</span> <span class="o">{</span>

					<span class="nx">oItem</span><span class="o">.</span><span class="nx">focusEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
				
				<span class="o">}</span>
			
			<span class="o">}</span>
	
	
			<span class="k">if</span> <span class="o">(!</span><span class="nx">oSubmenu</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_KEEP_OPEN</span><span class="o">))</span> <span class="o">{</span>
	
				<span class="nx">hide</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
	
			<span class="o">}</span>
			
		<span class="o">}</span>
	
	<span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onKeyDown</span>
<span class="c">* @description &quot;keydown&quot; event handler for the menu.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onKeyDown</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">1</span><span class="o">],</span>
        <span class="nx">oSubmenu</span><span class="o">,</span>
        <span class="nx">oItemCfg</span><span class="o">,</span>
        <span class="nx">oParentItem</span><span class="o">,</span>
        <span class="nx">oRoot</span><span class="o">,</span>
        <span class="nx">oNextItem</span><span class="o">,</span>
        <span class="nx">oBody</span><span class="o">,</span>
        <span class="nx">nBodyScrollTop</span><span class="o">,</span>
        <span class="nx">nBodyOffsetHeight</span><span class="o">,</span>
        <span class="nx">aItems</span><span class="o">,</span>
        <span class="nx">nItems</span><span class="o">,</span>
        <span class="nx">nNextItemOffsetTop</span><span class="o">,</span>
        <span class="nx">nScrollTarget</span><span class="o">,</span>
        <span class="nx">oParentMenu</span><span class="o">;</span>


	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_useHideDelay</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">_cancelHideDelay</span><span class="o">();</span>
	<span class="o">}</span>


    <span class="c">/*</span>
<span class="c">        This function is called to prevent a bug in Firefox.  In Firefox,</span>
<span class="c">        moving a DOM element into a stationary mouse pointer will cause the </span>
<span class="c">        browser to fire mouse events.  This can result in the menu mouse</span>
<span class="c">        event handlers being called uncessarily, especially when menus are </span>
<span class="c">        moved into a stationary mouse pointer as a result of a </span>
<span class="c">        key event handler.</span>
<span class="c">    */</span>
    <span class="k">function</span> <span class="nx">stopMouseEventHandlers</span><span class="o">()</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">_bStopMouseEventHandlers</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
        
        <span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="m">10</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_bStopMouseEventHandlers</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        
        <span class="o">});</span>

    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">oItemCfg</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>
        <span class="nx">oParentItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>

        <span class="nx">switch</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">.</span><span class="nx">keyCode</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="nx">case</span> <span class="m">38</span><span class="o">:</span>    <span class="c">// Up arrow</span>
<span class="c"></span>            <span class="nx">case</span> <span class="m">40</span><span class="o">:</span>    <span class="c">// Down arrow</span>
<span class="c"></span>    
                <span class="nx">oNextItem</span> <span class="o">=</span> <span class="o">(</span><span class="nx">oEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">38</span><span class="o">)</span> <span class="o">?</span> 
                    <span class="nx">oItem</span><span class="o">.</span><span class="nx">getPreviousEnabledSibling</span><span class="o">()</span> <span class="o">:</span> 
                    <span class="nx">oItem</span><span class="o">.</span><span class="nx">getNextEnabledSibling</span><span class="o">();</span>
        
                <span class="k">if</span> <span class="o">(</span><span class="nx">oNextItem</span><span class="o">)</span> <span class="o">{</span>

                    <span class="k">this</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">();</span>

                    <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                    <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>


                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MAX_HEIGHT</span><span class="o">)</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

                        <span class="nx">oBody</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
                        <span class="nx">nBodyScrollTop</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span><span class="o">;</span>
                        <span class="nx">nBodyOffsetHeight</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">;</span>
                        <span class="nx">aItems</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">();</span>
                        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>
                        <span class="nx">nNextItemOffsetTop</span> <span class="o">=</span> <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">offsetTop</span><span class="o">;</span>


                        <span class="k">if</span> <span class="o">(</span><span class="nx">oEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">40</span> <span class="o">)</span> <span class="o">{</span>    <span class="c">// Down</span>
<span class="c"></span>                       
                            <span class="k">if</span> <span class="o">(</span><span class="nx">nNextItemOffsetTop</span> <span class="o">&gt;=</span> <span class="o">(</span><span class="nx">nBodyOffsetHeight</span> <span class="o">+</span> <span class="nx">nBodyScrollTop</span><span class="o">))</span> <span class="o">{</span>

                                <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="nx">nNextItemOffsetTop</span> <span class="o">-</span> <span class="nx">nBodyOffsetHeight</span><span class="o">;</span>

                            <span class="o">}</span>
                            <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">nNextItemOffsetTop</span> <span class="o">&lt;=</span> <span class="nx">nBodyScrollTop</span><span class="o">)</span> <span class="o">{</span>
                            
                                <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                            
                            <span class="o">}</span>


                            <span class="k">if</span> <span class="o">(</span><span class="nx">oNextItem</span> <span class="o">==</span> <span class="nx">aItems</span><span class="o">[</span><span class="nx">nItems</span><span class="o">])</span> <span class="o">{</span>

                                <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">offsetTop</span><span class="o">;</span>

                            <span class="o">}</span>

                        <span class="o">}</span>
                        <span class="k">else</span> <span class="o">{</span>  <span class="c">// Up</span>
<span class="c"></span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">nNextItemOffsetTop</span> <span class="o">&lt;=</span> <span class="nx">nBodyScrollTop</span><span class="o">)</span> <span class="o">{</span>

                                <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="nx">nNextItemOffsetTop</span> <span class="o">-</span> <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">;</span>
                            
                            <span class="o">}</span>
                            <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">nNextItemOffsetTop</span> <span class="o">&gt;=</span> <span class="o">(</span><span class="nx">nBodyScrollTop</span> <span class="o">+</span> <span class="nx">nBodyOffsetHeight</span><span class="o">))</span> <span class="o">{</span>
                            
                                <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="nx">nNextItemOffsetTop</span><span class="o">;</span>
                            
                            <span class="o">}</span>


                            <span class="k">if</span> <span class="o">(</span><span class="nx">oNextItem</span> <span class="o">==</span> <span class="nx">aItems</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                            
                                <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                            
                            <span class="o">}</span>

                        <span class="o">}</span>


                        <span class="nx">nBodyScrollTop</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span><span class="o">;</span>
                        <span class="nx">nScrollTarget</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollHeight</span> <span class="o">-</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">;</span>

                        <span class="k">if</span> <span class="o">(</span><span class="nx">nBodyScrollTop</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

                            <span class="k">this</span><span class="o">.</span><span class="nx">_disableScrollHeader</span><span class="o">();</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollFooter</span><span class="o">();</span>

                        <span class="o">}</span>
                        <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">nBodyScrollTop</span> <span class="o">==</span> <span class="nx">nScrollTarget</span><span class="o">)</span> <span class="o">{</span>

                             <span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollHeader</span><span class="o">();</span>
                             <span class="k">this</span><span class="o">.</span><span class="nx">_disableScrollFooter</span><span class="o">();</span>

                        <span class="o">}</span>
                        <span class="k">else</span> <span class="o">{</span>

                            <span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollHeader</span><span class="o">();</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollFooter</span><span class="o">();</span>

                        <span class="o">}</span>

                    <span class="o">}</span>

                <span class="o">}</span>

    
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>

                <span class="nx">stopMouseEventHandlers</span><span class="o">();</span>
    
            <span class="k">break</span><span class="o">;</span>
            
    
            <span class="nx">case</span> <span class="m">39</span><span class="o">:</span>    <span class="c">// Right arrow</span>
<span class="c"></span>    
                <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItemCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
    
                <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
    
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">oItemCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">))</span> <span class="o">{</span>
        
                        <span class="nx">oItemCfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        
                    <span class="o">}</span>
    
                    <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">show</span><span class="o">();</span>
                    <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">setInitialFocus</span><span class="o">();</span>
                    <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">setInitialSelection</span><span class="o">();</span>
    
                <span class="o">}</span>
                <span class="k">else</span> <span class="o">{</span>
    
                    <span class="nx">oRoot</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">();</span>
                    
                    <span class="k">if</span> <span class="o">(</span><span class="nx">oRoot</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">)</span> <span class="o">{</span>
    
                        <span class="nx">oNextItem</span> <span class="o">=</span> <span class="nx">oRoot</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">getNextEnabledSibling</span><span class="o">();</span>
    
                        <span class="k">if</span> <span class="o">(</span><span class="nx">oNextItem</span><span class="o">)</span> <span class="o">{</span>
                        
                            <span class="nx">oRoot</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">();</span>
    
                            <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    
                            <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
    
                            <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
    
                                <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">show</span><span class="o">();</span>
                                <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">setInitialFocus</span><span class="o">();</span>
                            
                            <span class="o">}</span>
                            <span class="k">else</span> <span class="o">{</span>
    
                            	<span class="nx">oNextItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
                            
                            <span class="o">}</span>
                        
                        <span class="o">}</span>
                    
                    <span class="o">}</span>
                
                <span class="o">}</span>
    
    
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>

                <span class="nx">stopMouseEventHandlers</span><span class="o">();</span>

            <span class="k">break</span><span class="o">;</span>
    
    
            <span class="nx">case</span> <span class="m">37</span><span class="o">:</span>    <span class="c">// Left arrow</span>
<span class="c"></span>    
                <span class="k">if</span> <span class="o">(</span><span class="nx">oParentItem</span><span class="o">)</span> <span class="o">{</span>
    
                    <span class="nx">oParentMenu</span> <span class="o">=</span> <span class="nx">oParentItem</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
    
                    <span class="k">if</span> <span class="o">(</span><span class="nx">oParentMenu</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">)</span> <span class="o">{</span>
    
                        <span class="nx">oNextItem</span> <span class="o">=</span> 
                            <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">getPreviousEnabledSibling</span><span class="o">();</span>
    
                        <span class="k">if</span> <span class="o">(</span><span class="nx">oNextItem</span><span class="o">)</span> <span class="o">{</span>
                        
                            <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">();</span>
    
                            <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    
                            <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oNextItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
    
                            <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
                            
                                <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">show</span><span class="o">();</span>
								<span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">setInitialFocus</span><span class="o">();</span>                                
                            
                            <span class="o">}</span>
                            <span class="k">else</span> <span class="o">{</span>
    
                            	<span class="nx">oNextItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
                            
                            <span class="o">}</span>
                        
                        <span class="o">}</span> 
                    
                    <span class="o">}</span>
                    <span class="k">else</span> <span class="o">{</span>
    
                        <span class="k">this</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>
    
                        <span class="nx">oParentItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
                    
                    <span class="o">}</span>
    
                <span class="o">}</span>
    
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>

                <span class="nx">stopMouseEventHandlers</span><span class="o">();</span>

            <span class="k">break</span><span class="o">;</span>        
    
        <span class="o">}</span>


    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">27</span><span class="o">)</span> <span class="o">{</span> <span class="c">// Esc key</span>
<span class="c"></span>
        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>
        
            <span class="k">this</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
            
            <span class="o">}</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span> <span class="o">&amp;&amp;</span> <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_VISIBLE</span><span class="o">))</span> <span class="o">{</span>
            
                <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
            
            <span class="o">}</span>
            <span class="k">else</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
        
            <span class="o">}</span>
        
        <span class="o">}</span>


        <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>
    
    <span class="o">}</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onKeyPress</span>
<span class="c">* @description &quot;keypress&quot; event handler for a Menu instance.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event </span>
<span class="c">* was fired.</span>
<span class="c">*/</span>
<span class="nx">_onKeyPress</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>
    
    <span class="k">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">40</span> <span class="o">||</span> <span class="nx">oEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">38</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">oEvent</span><span class="o">);</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onBlur</span>
<span class="c">* @description &quot;blur&quot; event handler for a Menu instance.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event </span>
<span class="c">* was fired.</span>
<span class="c">*/</span>
<span class="nx">_onBlur</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>
        
	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasFocus</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">_hasFocus</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
	<span class="o">}</span>

<span class="o">},</span>

<span class="c">/**</span>
<span class="c">* @method _onYChange</span>
<span class="c">* @description &quot;y&quot; event handler for a Menu instance.</span>
<span class="c">* @protected</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event </span>
<span class="c">* was fired.</span>
<span class="c">*/</span>
<span class="nx">_onYChange</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oParent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
        <span class="nx">nScrollTop</span><span class="o">,</span>
        <span class="nx">oIFrame</span><span class="o">,</span>
        <span class="nx">nY</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oParent</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">nScrollTop</span> <span class="o">=</span> <span class="nx">oParent</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">scrollTop</span><span class="o">;</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">nScrollTop</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="nx">nY</span> <span class="o">=</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">)</span> <span class="o">-</span> <span class="nx">nScrollTop</span><span class="o">);</span>
            
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">setY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">nY</span><span class="o">);</span>

            <span class="nx">oIFrame</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">;</span>            
    

            <span class="k">if</span> <span class="o">(</span><span class="nx">oIFrame</span><span class="o">)</span> <span class="o">{</span>
    
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">setY</span><span class="o">(</span><span class="nx">oIFrame</span><span class="o">,</span> <span class="nx">nY</span><span class="o">);</span>
    
            <span class="o">}</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">,</span> <span class="nx">nY</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        
        <span class="o">}</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onScrollTargetMouseOver</span>
<span class="c">* @description &quot;mouseover&quot; event handler for the menu&#39;s &quot;header&quot; and &quot;footer&quot; </span>
<span class="c">* elements.  Used to scroll the body of the menu up and down when the </span>
<span class="c">* menu&#39;s &quot;maxheight&quot; configuration property is set to a value greater than 0.</span>
<span class="c">* @protected</span>
<span class="c">* @param {Event} p_oEvent Object representing the DOM event object passed </span>
<span class="c">* back by the event utility (YAHOO.util.Event).</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">_onScrollTargetMouseOver</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oEvent</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">oBodyScrollTimer</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_bodyScrollTimer</span><span class="o">;</span>


	<span class="k">if</span> <span class="o">(</span><span class="nx">oBodyScrollTimer</span><span class="o">)</span> <span class="o">{</span>

		<span class="nx">oBodyScrollTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>

	<span class="o">}</span>


	<span class="k">this</span><span class="o">.</span><span class="nx">_cancelHideDelay</span><span class="o">();</span>


    <span class="k">var</span> <span class="nx">oTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">p_oEvent</span><span class="o">),</span>
        <span class="nx">oBody</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">body</span><span class="o">,</span>
        <span class="nx">nScrollIncrement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SCROLL_INCREMENT</span><span class="o">),</span>
        <span class="nx">nScrollTarget</span><span class="o">,</span>
        <span class="nx">fnScrollFunction</span><span class="o">;</span>


    <span class="k">function</span> <span class="nx">scrollBodyDown</span><span class="o">()</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">nScrollTop</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span><span class="o">;</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">nScrollTop</span> <span class="o">&lt;</span> <span class="nx">nScrollTarget</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nScrollTop</span> <span class="o">+</span> <span class="nx">nScrollIncrement</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollHeader</span><span class="o">();</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="nx">nScrollTarget</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_bodyScrollTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_disableScrollFooter</span><span class="o">();</span>

        <span class="o">}</span>

    <span class="o">}</span>


    <span class="k">function</span> <span class="nx">scrollBodyUp</span><span class="o">()</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">nScrollTop</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span><span class="o">;</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">nScrollTop</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nScrollTop</span> <span class="o">-</span> <span class="nx">nScrollIncrement</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollFooter</span><span class="o">();</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

			<span class="k">this</span><span class="o">.</span><span class="nx">_bodyScrollTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_disableScrollHeader</span><span class="o">();</span>

        <span class="o">}</span>

    <span class="o">}</span>

    
    <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">oTarget</span><span class="o">,</span> <span class="nx">_HD</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">fnScrollFunction</span> <span class="o">=</span> <span class="nx">scrollBodyUp</span><span class="o">;</span>
    
    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>

        <span class="nx">nScrollTarget</span> <span class="o">=</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollHeight</span> <span class="o">-</span> <span class="nx">oBody</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">;</span>

        <span class="nx">fnScrollFunction</span> <span class="o">=</span> <span class="nx">scrollBodyDown</span><span class="o">;</span>
    
    <span class="o">}</span>
    

    <span class="k">this</span><span class="o">.</span><span class="nx">_bodyScrollTimer</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="m">10</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="nx">fnScrollFunction</span><span class="o">,</span> <span class="kc">null</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onScrollTargetMouseOut</span>
<span class="c">* @description &quot;mouseout&quot; event handler for the menu&#39;s &quot;header&quot; and &quot;footer&quot; </span>
<span class="c">* elements.  Used to stop scrolling the body of the menu up and down when the </span>
<span class="c">* menu&#39;s &quot;maxheight&quot; configuration property is set to a value greater than 0.</span>
<span class="c">* @protected</span>
<span class="c">* @param {Event} p_oEvent Object representing the DOM event object passed </span>
<span class="c">* back by the event utility (YAHOO.util.Event).</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">_onScrollTargetMouseOut</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oEvent</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">oBodyScrollTimer</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_bodyScrollTimer</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">oBodyScrollTimer</span><span class="o">)</span> <span class="o">{</span>

		<span class="nx">oBodyScrollTimer</span><span class="o">.</span><span class="nx">cancel</span><span class="o">();</span>

	<span class="o">}</span>
	
    <span class="k">this</span><span class="o">.</span><span class="nx">_cancelHideDelay</span><span class="o">();</span>

<span class="o">},</span>



<span class="c">// Private methods</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @method _onInit</span>
<span class="c">* @description &quot;init&quot; event handler for the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onInit</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_VISIBLE</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onVisibleChange</span><span class="o">);</span>

    <span class="k">var</span> <span class="nx">bRootMenu</span> <span class="o">=</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
        <span class="nx">bLazyLoad</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">lazyLoad</span><span class="o">;</span>


    <span class="c">/*</span>
<span class="c">        Automatically initialize a menu&#39;s subtree if:</span>
<span class="c"></span>
<span class="c">        1) This is the root menu and lazyload is off</span>
<span class="c">        </span>
<span class="c">        2) This is the root menu, lazyload is on, but the menu is </span>
<span class="c">           already visible</span>
<span class="c"></span>
<span class="c">        3) This menu is a submenu and lazyload is off</span>
<span class="c">    */</span>



    <span class="k">if</span> <span class="o">(((</span><span class="nx">bRootMenu</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">bLazyLoad</span><span class="o">)</span> <span class="o">||</span> 
        <span class="o">(</span><span class="nx">bRootMenu</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_VISIBLE</span><span class="o">)</span> <span class="o">||</span> 
        <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_STATIC</span><span class="o">))</span> <span class="o">||</span> 
        <span class="o">(!</span><span class="nx">bRootMenu</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">bLazyLoad</span><span class="o">))</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItemGroups</span><span class="o">().</span><span class="nx">length</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_initSubTree</span><span class="o">();</span>
        
        <span class="o">}</span>


        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">addItems</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">);</span>

        <span class="o">}</span>
    
    <span class="o">}</span>
    <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">bLazyLoad</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">fireQueue</span><span class="o">();</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onBeforeRender</span>
<span class="c">* @description &quot;beforerender&quot; event handler for the menu.  Appends all of the </span>
<span class="c">* &lt;code&gt;&amp;#60;ul&amp;#62;&lt;/code&gt;, &lt;code&gt;&amp;#60;li&amp;#62;&lt;/code&gt; and their accompanying </span>
<span class="c">* title elements to the body element of the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onBeforeRender</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
        <span class="nx">nListElements</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">.</span><span class="nx">length</span><span class="o">,</span>
        <span class="nx">bFirstList</span> <span class="o">=</span> <span class="kc">true</span><span class="o">,</span>
        <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
        <span class="nx">oUL</span><span class="o">,</span>
        <span class="nx">oGroupTitle</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">nListElements</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">do</span> <span class="o">{</span>

            <span class="nx">oUL</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oUL</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">bFirstList</span><span class="o">)</span> <span class="o">{</span>
        
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oUL</span><span class="o">,</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>
                    <span class="nx">bFirstList</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        
                <span class="o">}</span>


                <span class="k">if</span> <span class="o">(!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oEl</span><span class="o">,</span> <span class="nx">oUL</span><span class="o">))</span> <span class="o">{</span>

                    <span class="k">this</span><span class="o">.</span><span class="nx">appendToBody</span><span class="o">(</span><span class="nx">oUL</span><span class="o">);</span>

                <span class="o">}</span>


                <span class="nx">oGroupTitle</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">oGroupTitle</span><span class="o">)</span> <span class="o">{</span>

                    <span class="k">if</span> <span class="o">(!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oEl</span><span class="o">,</span> <span class="nx">oGroupTitle</span><span class="o">))</span> <span class="o">{</span>

                        <span class="nx">oUL</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">oGroupTitle</span><span class="o">,</span> <span class="nx">oUL</span><span class="o">);</span>

                    <span class="o">}</span>


                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oUL</span><span class="o">,</span> <span class="nx">_HAS_TITLE</span><span class="o">);</span>

                <span class="o">}</span>

            <span class="o">}</span>

            <span class="nx">i</span><span class="o">++;</span>

        <span class="o">}</span>
        <span class="k">while</span> <span class="o">(</span><span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">nListElements</span><span class="o">);</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onRender</span>
<span class="c">* @description &quot;render&quot; event handler for the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onRender</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span> 

        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_VISIBLE</span><span class="o">))</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">positionOffScreen</span><span class="o">();</span>

        <span class="o">}</span>
    
    <span class="o">}</span>

<span class="o">},</span>





<span class="c">/**</span>
<span class="c">* @method _onBeforeShow</span>
<span class="c">* @description &quot;beforeshow&quot; event handler for the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onBeforeShow</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nOptions</span><span class="o">,</span>
        <span class="nx">n</span><span class="o">,</span>
        <span class="nx">oSrcElement</span><span class="o">,</span>
        <span class="nx">oContainer</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_CONTAINER</span><span class="o">);</span>


    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">lazyLoad</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItemGroups</span><span class="o">().</span><span class="nx">length</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">)</span> <span class="o">{</span>
        
            <span class="k">this</span><span class="o">.</span><span class="nx">_initSubTree</span><span class="o">();</span>

        <span class="o">}</span>


        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">parent</span> <span class="o">&amp;&amp;</span> 
                <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">srcElement</span> <span class="o">&amp;&amp;</span> 
                <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> 
                <span class="nx">_SELECT</span><span class="o">)</span> <span class="o">{</span>

                <span class="nx">nOptions</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
    
                <span class="k">for</span><span class="o">(</span><span class="nx">n</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">n</span><span class="o">&lt;</span><span class="nx">nOptions</span><span class="o">;</span> <span class="nx">n</span><span class="o">++)</span> <span class="o">{</span>

                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">[</span><span class="nx">n</span><span class="o">].</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>

                        <span class="k">this</span><span class="o">.</span><span class="nx">addItem</span><span class="o">((</span><span class="k">new</span> <span class="k">this</span><span class="o">.</span><span class="nx">ITEM_TYPE</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">[</span><span class="nx">n</span><span class="o">])));</span>
    
                    <span class="o">}</span>
    
                <span class="o">}</span>
            
            <span class="o">}</span>
            <span class="k">else</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">addItems</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">itemData</span><span class="o">);</span>
            
            <span class="o">}</span>
        
        <span class="o">}</span>


        <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">srcElement</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oSrcElement</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oSrcElement</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">_SELECT</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">inDocument</span><span class="o">(</span><span class="nx">oSrcElement</span><span class="o">))</span> <span class="o">{</span>

                    <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">(</span><span class="nx">oSrcElement</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">);</span>
                
                <span class="o">}</span>
                <span class="k">else</span> <span class="o">{</span>
                
                    <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">(</span><span class="nx">oContainer</span><span class="o">);</span>
                
                <span class="o">}</span>

            <span class="o">}</span>
            <span class="k">else</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">();</span>

            <span class="o">}</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>     

            <span class="o">}</span>
            <span class="k">else</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">(</span><span class="nx">oContainer</span><span class="o">);</span>

            <span class="o">}</span>                

        <span class="o">}</span>

    <span class="o">}</span>



    <span class="k">var</span> <span class="nx">oParent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
		<span class="nx">aAlignment</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(!</span><span class="nx">oParent</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">_XY</span><span class="o">);</span>
   
    <span class="o">}</span>


	<span class="k">if</span> <span class="o">(</span><span class="nx">oParent</span><span class="o">)</span> <span class="o">{</span>

		<span class="nx">aAlignment</span> <span class="o">=</span> <span class="nx">oParent</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU_ALIGNMENT</span><span class="o">);</span>
		
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_CONTEXT</span><span class="o">,</span> <span class="o">[</span><span class="nx">oParent</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">aAlignment</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="nx">aAlignment</span><span class="o">[</span><span class="m">1</span><span class="o">]]);</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">align</span><span class="o">();</span>
	
	<span class="o">}</span>

<span class="o">},</span>


<span class="nx">getConstrainedY</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">y</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
	
		<span class="nx">aContext</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_CONTEXT</span><span class="o">),</span>
		<span class="nx">nInitialMaxHeight</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MAX_HEIGHT</span><span class="o">),</span>

		<span class="nx">nMaxHeight</span><span class="o">,</span>

		<span class="nx">oOverlapPositions</span> <span class="o">=</span> <span class="o">{</span>

			<span class="s2">&quot;trbr&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
			<span class="s2">&quot;tlbl&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
			<span class="s2">&quot;bltl&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
			<span class="s2">&quot;brtr&quot;</span><span class="o">:</span> <span class="kc">true</span>

		<span class="o">},</span>

		<span class="nx">bPotentialContextOverlap</span> <span class="o">=</span> <span class="o">(</span><span class="nx">aContext</span> <span class="o">&amp;&amp;</span> <span class="nx">oOverlapPositions</span><span class="o">[</span><span class="nx">aContext</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="nx">aContext</span><span class="o">[</span><span class="m">2</span><span class="o">]]),</span>
	
		<span class="nx">oMenuEl</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
		<span class="nx">nMenuOffsetHeight</span> <span class="o">=</span> <span class="nx">oMenuEl</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">,</span>
	
		<span class="nx">nViewportOffset</span> <span class="o">=</span> <span class="nx">Overlay</span><span class="o">.</span><span class="nx">VIEWPORT_OFFSET</span><span class="o">,</span>
		<span class="nx">viewPortHeight</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getViewportHeight</span><span class="o">(),</span>
		<span class="nx">scrollY</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getDocumentScrollTop</span><span class="o">(),</span>

		<span class="nx">bCanConstrain</span> <span class="o">=</span> 
			<span class="o">(</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">)</span> <span class="o">+</span> <span class="nx">nViewportOffset</span> <span class="o">&lt;</span> <span class="nx">viewPortHeight</span><span class="o">),</span>

		<span class="nx">nAvailableHeight</span><span class="o">,</span>

		<span class="nx">oContextEl</span><span class="o">,</span>
		<span class="nx">nContextElY</span><span class="o">,</span>
		<span class="nx">nContextElHeight</span><span class="o">,</span>

		<span class="nx">bFlipped</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>

		<span class="nx">nTopRegionHeight</span><span class="o">,</span>
		<span class="nx">nBottomRegionHeight</span><span class="o">,</span>

		<span class="nx">topConstraint</span> <span class="o">=</span> <span class="nx">scrollY</span> <span class="o">+</span> <span class="nx">nViewportOffset</span><span class="o">,</span>
		<span class="nx">bottomConstraint</span> <span class="o">=</span> <span class="nx">scrollY</span> <span class="o">+</span> <span class="nx">viewPortHeight</span> <span class="o">-</span> <span class="nx">nMenuOffsetHeight</span> <span class="o">-</span> <span class="nx">nViewportOffset</span><span class="o">,</span>

		<span class="nx">yNew</span> <span class="o">=</span> <span class="nx">y</span><span class="o">;</span>
		

	<span class="k">var</span> <span class="nx">flipVertical</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

		<span class="k">var</span> <span class="nx">nNewY</span><span class="o">;</span>
	
		<span class="c">// The Menu is below the context element, flip it above</span>
<span class="c"></span>		<span class="k">if</span> <span class="o">((</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">)</span> <span class="o">-</span> <span class="nx">scrollY</span><span class="o">)</span> <span class="o">&gt;</span> <span class="nx">nContextElY</span><span class="o">)</span> <span class="o">{</span> 
			<span class="nx">nNewY</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nContextElY</span> <span class="o">-</span> <span class="nx">nMenuOffsetHeight</span><span class="o">);</span>
		<span class="o">}</span>
		<span class="k">else</span> <span class="o">{</span>	<span class="c">// The Menu is above the context element, flip it below</span>
<span class="c"></span>			<span class="nx">nNewY</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nContextElY</span> <span class="o">+</span> <span class="nx">nContextElHeight</span><span class="o">);</span>
		<span class="o">}</span>

		<span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">,</span> <span class="o">(</span><span class="nx">nNewY</span> <span class="o">+</span> <span class="nx">scrollY</span><span class="o">),</span> <span class="kc">true</span><span class="o">);</span>
		
		<span class="k">return</span> <span class="nx">nNewY</span><span class="o">;</span>
	
	<span class="o">};</span>


	<span class="c">/*</span>
<span class="c">		 Uses the context element&#39;s position to calculate the availble height </span>
<span class="c">		 above and below it to display its corresponding Menu.</span>
<span class="c">	*/</span>

	<span class="k">var</span> <span class="nx">getDisplayRegionHeight</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

		<span class="c">// The Menu is below the context element</span>
<span class="c"></span>		<span class="k">if</span> <span class="o">((</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">)</span> <span class="o">-</span> <span class="nx">scrollY</span><span class="o">)</span> <span class="o">&gt;</span> <span class="nx">nContextElY</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">return</span> <span class="o">(</span><span class="nx">nBottomRegionHeight</span> <span class="o">-</span> <span class="nx">nViewportOffset</span><span class="o">);</span>				
		<span class="o">}</span>
		<span class="k">else</span> <span class="o">{</span>	<span class="c">// The Menu is above the context element</span>
<span class="c"></span>			<span class="k">return</span> <span class="o">(</span><span class="nx">nTopRegionHeight</span> <span class="o">-</span> <span class="nx">nViewportOffset</span><span class="o">);</span>				
		<span class="o">}</span>

	<span class="o">};</span>


	<span class="c">/*</span>
<span class="c">		Sets the Menu&#39;s &quot;y&quot; configuration property to the correct value based on its</span>
<span class="c">		current orientation.</span>
<span class="c">	*/</span> 

	<span class="k">var</span> <span class="nx">alignY</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

		<span class="k">var</span> <span class="nx">nNewY</span><span class="o">;</span>

		<span class="k">if</span> <span class="o">((</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">)</span> <span class="o">-</span> <span class="nx">scrollY</span><span class="o">)</span> <span class="o">&gt;</span> <span class="nx">nContextElY</span><span class="o">)</span> <span class="o">{</span> 
			<span class="nx">nNewY</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nContextElY</span> <span class="o">+</span> <span class="nx">nContextElHeight</span><span class="o">);</span>
		<span class="o">}</span>
		<span class="k">else</span> <span class="o">{</span>	
			<span class="nx">nNewY</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nContextElY</span> <span class="o">-</span> <span class="nx">oMenuEl</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">);</span>
		<span class="o">}</span>

		<span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">,</span> <span class="o">(</span><span class="nx">nNewY</span> <span class="o">+</span> <span class="nx">scrollY</span><span class="o">),</span> <span class="kc">true</span><span class="o">);</span>
	
	<span class="o">};</span>


	<span class="c">//	Resets the maxheight of the Menu to the value set by the user</span>
<span class="c"></span>
	<span class="k">var</span> <span class="nx">resetMaxHeight</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

		<span class="nx">oMenu</span><span class="o">.</span><span class="nx">_setScrollHeight</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MAX_HEIGHT</span><span class="o">));</span>

		<span class="nx">oMenu</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="nx">resetMaxHeight</span><span class="o">);</span>
	
	<span class="o">};</span>


	<span class="c">/*</span>
<span class="c">		Trys to place the Menu in the best possible position (either above or </span>
<span class="c">		below its corresponding context element).</span>
<span class="c">	*/</span>

	<span class="k">var</span> <span class="nx">setVerticalPosition</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

		<span class="k">var</span> <span class="nx">nDisplayRegionHeight</span> <span class="o">=</span> <span class="nx">getDisplayRegionHeight</span><span class="o">(),</span>
			<span class="nx">bMenuHasItems</span> <span class="o">=</span> <span class="o">(</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">getItems</span><span class="o">().</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">),</span>
			<span class="nx">nMenuMinScrollHeight</span><span class="o">,</span>
			<span class="nx">fnReturnVal</span><span class="o">;</span>


		<span class="k">if</span> <span class="o">(</span><span class="nx">nMenuOffsetHeight</span> <span class="o">&gt;</span> <span class="nx">nDisplayRegionHeight</span><span class="o">)</span> <span class="o">{</span>

			<span class="nx">nMenuMinScrollHeight</span> <span class="o">=</span> 
				<span class="nx">bMenuHasItems</span> <span class="o">?</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">)</span> <span class="o">:</span> <span class="nx">nMenuOffsetHeight</span><span class="o">;</span>


			<span class="k">if</span> <span class="o">((</span><span class="nx">nDisplayRegionHeight</span> <span class="o">&gt;</span> <span class="nx">nMenuMinScrollHeight</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">bMenuHasItems</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">nMaxHeight</span> <span class="o">=</span> <span class="nx">nDisplayRegionHeight</span><span class="o">;</span>
			<span class="o">}</span>
			<span class="k">else</span> <span class="o">{</span>
				<span class="nx">nMaxHeight</span> <span class="o">=</span> <span class="nx">nInitialMaxHeight</span><span class="o">;</span>
			<span class="o">}</span>


			<span class="nx">oMenu</span><span class="o">.</span><span class="nx">_setScrollHeight</span><span class="o">(</span><span class="nx">nMaxHeight</span><span class="o">);</span>
			<span class="nx">oMenu</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">resetMaxHeight</span><span class="o">);</span>
			

			<span class="c">// Re-align the Menu since its height has just changed</span>
<span class="c"></span>			<span class="c">// as a result of the setting of the maxheight property.</span>
<span class="c"></span>
			<span class="nx">alignY</span><span class="o">();</span>
			

			<span class="k">if</span> <span class="o">(</span><span class="nx">nDisplayRegionHeight</span> <span class="o">&lt;</span> <span class="nx">nMenuMinScrollHeight</span><span class="o">)</span> <span class="o">{</span>

				<span class="k">if</span> <span class="o">(</span><span class="nx">bFlipped</span><span class="o">)</span> <span class="o">{</span>
	
					<span class="c">/*</span>
<span class="c">						 All possible positions and values for the &quot;maxheight&quot; </span>
<span class="c">						 configuration property have been tried, but none were </span>
<span class="c">						 successful, so fall back to the original size and position.</span>
<span class="c">					*/</span>

					<span class="nx">flipVertical</span><span class="o">();</span>
					
				<span class="o">}</span>
				<span class="k">else</span> <span class="o">{</span>
	
					<span class="nx">flipVertical</span><span class="o">();</span>

					<span class="nx">bFlipped</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
	
					<span class="nx">fnReturnVal</span> <span class="o">=</span> <span class="nx">setVerticalPosition</span><span class="o">();</span>
	
				<span class="o">}</span>
				
			<span class="o">}</span>
		
		<span class="o">}</span>
		<span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">nMaxHeight</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">nMaxHeight</span> <span class="o">!==</span> <span class="nx">nInitialMaxHeight</span><span class="o">))</span> <span class="o">{</span>
		
			<span class="nx">oMenu</span><span class="o">.</span><span class="nx">_setScrollHeight</span><span class="o">(</span><span class="nx">nInitialMaxHeight</span><span class="o">);</span>
			<span class="nx">oMenu</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">resetMaxHeight</span><span class="o">);</span>

			<span class="c">// Re-align the Menu since its height has just changed</span>
<span class="c"></span>			<span class="c">// as a result of the setting of the maxheight property.</span>
<span class="c"></span>
			<span class="nx">alignY</span><span class="o">();</span>
		
		<span class="o">}</span>

		<span class="k">return</span> <span class="nx">fnReturnVal</span><span class="o">;</span>

	<span class="o">};</span>


	<span class="c">// Determine if the current value for the Menu&#39;s &quot;y&quot; configuration property will</span>
<span class="c"></span>	<span class="c">// result in the Menu being positioned outside the boundaries of the viewport</span>
<span class="c"></span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">y</span> <span class="o">&lt;</span> <span class="nx">topConstraint</span> <span class="o">||</span> <span class="nx">y</span>  <span class="o">&gt;</span> <span class="nx">bottomConstraint</span><span class="o">)</span> <span class="o">{</span>

		<span class="c">// The current value for the Menu&#39;s &quot;y&quot; configuration property WILL</span>
<span class="c"></span>		<span class="c">// result in the Menu being positioned outside the boundaries of the viewport</span>
<span class="c"></span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">bCanConstrain</span><span class="o">)</span> <span class="o">{</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_PREVENT_CONTEXT_OVERLAP</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">bPotentialContextOverlap</span><span class="o">)</span> <span class="o">{</span>
		
				<span class="c">//	SOLUTION #1:</span>
<span class="c"></span>				<span class="c">//	If the &quot;preventcontextoverlap&quot; configuration property is set to &quot;true&quot;, </span>
<span class="c"></span>				<span class="c">//	try to flip and/or scroll the Menu to both keep it inside the boundaries of the </span>
<span class="c"></span>				<span class="c">//	viewport AND from overlaping its context element (MenuItem or MenuBarItem).</span>
<span class="c"></span>
				<span class="nx">oContextEl</span> <span class="o">=</span> <span class="nx">aContext</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
				<span class="nx">nContextElHeight</span> <span class="o">=</span> <span class="nx">oContextEl</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">;</span>
				<span class="nx">nContextElY</span> <span class="o">=</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getY</span><span class="o">(</span><span class="nx">oContextEl</span><span class="o">)</span> <span class="o">-</span> <span class="nx">scrollY</span><span class="o">);</span>
	
				<span class="nx">nTopRegionHeight</span> <span class="o">=</span> <span class="nx">nContextElY</span><span class="o">;</span>
				<span class="nx">nBottomRegionHeight</span> <span class="o">=</span> <span class="o">(</span><span class="nx">viewPortHeight</span> <span class="o">-</span> <span class="o">(</span><span class="nx">nContextElY</span> <span class="o">+</span> <span class="nx">nContextElHeight</span><span class="o">));</span>
	
				<span class="nx">setVerticalPosition</span><span class="o">();</span>
				
				<span class="nx">yNew</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">);</span>
		
			<span class="o">}</span>
			<span class="k">else</span> <span class="k">if</span> <span class="o">(!(</span><span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">)</span> <span class="o">&amp;&amp;</span> 
				<span class="nx">nMenuOffsetHeight</span> <span class="o">&gt;=</span> <span class="nx">viewPortHeight</span><span class="o">)</span> <span class="o">{</span>

				<span class="c">//	SOLUTION #2:</span>
<span class="c"></span>				<span class="c">//	If the Menu exceeds the height of the viewport, introduce scroll bars</span>
<span class="c"></span>				<span class="c">//	to keep the Menu inside the boundaries of the viewport</span>
<span class="c"></span>
				<span class="nx">nAvailableHeight</span> <span class="o">=</span> <span class="o">(</span><span class="nx">viewPortHeight</span> <span class="o">-</span> <span class="o">(</span><span class="nx">nViewportOffset</span> <span class="o">*</span> <span class="m">2</span><span class="o">));</span>
		
				<span class="k">if</span> <span class="o">(</span><span class="nx">nAvailableHeight</span> <span class="o">&gt;</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">))</span> <span class="o">{</span>
		
					<span class="nx">oMenu</span><span class="o">.</span><span class="nx">_setScrollHeight</span><span class="o">(</span><span class="nx">nAvailableHeight</span><span class="o">);</span>
					<span class="nx">oMenu</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">resetMaxHeight</span><span class="o">);</span>
		
					<span class="nx">alignY</span><span class="o">();</span>
					
					<span class="nx">yNew</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_Y</span><span class="o">);</span>
				
				<span class="o">}</span>
		
			<span class="o">}</span>	
			<span class="k">else</span> <span class="o">{</span>

				<span class="c">//	SOLUTION #3:</span>
<span class="c"></span>			
				<span class="k">if</span> <span class="o">(</span><span class="nx">y</span> <span class="o">&lt;</span> <span class="nx">topConstraint</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">yNew</span>  <span class="o">=</span> <span class="nx">topConstraint</span><span class="o">;</span>
				<span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">y</span>  <span class="o">&gt;</span> <span class="nx">bottomConstraint</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">yNew</span>  <span class="o">=</span> <span class="nx">bottomConstraint</span><span class="o">;</span>
				<span class="o">}</span>				
			
			<span class="o">}</span>

		<span class="o">}</span>
		<span class="k">else</span> <span class="o">{</span>
			<span class="c">//	The &quot;y&quot; configuration property cannot be set to a value that will keep</span>
<span class="c"></span>			<span class="c">//	entire Menu inside the boundary of the viewport.  Therefore, set  </span>
<span class="c"></span>			<span class="c">//	the &quot;y&quot; configuration property to scrollY to keep as much of the </span>
<span class="c"></span>			<span class="c">//	Menu inside the viewport as possible.</span>
<span class="c"></span>			<span class="nx">yNew</span> <span class="o">=</span> <span class="nx">nViewportOffset</span> <span class="o">+</span> <span class="nx">scrollY</span><span class="o">;</span>
		<span class="o">}</span>	

	<span class="o">}</span>

	<span class="k">return</span> <span class="nx">yNew</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onHide</span>
<span class="c">* @description &quot;hide&quot; event handler for the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onHide</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">===</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>
	
		<span class="k">this</span><span class="o">.</span><span class="nx">positionOffScreen</span><span class="o">();</span>
	
	<span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onShow</span>
<span class="c">* @description &quot;show&quot; event handler for the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onShow</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oParent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
        <span class="nx">oParentMenu</span><span class="o">,</span>
		<span class="nx">oElement</span><span class="o">,</span>
		<span class="nx">nOffsetWidth</span><span class="o">,</span>
		<span class="nx">sWidth</span><span class="o">;</span>        


    <span class="k">function</span> <span class="nx">disableAutoSubmenuDisplay</span><span class="o">(</span><span class="nx">p_oEvent</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">oTarget</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">p_oEvent</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">_MOUSEDOWN</span> <span class="o">||</span> <span class="o">(</span><span class="nx">p_oEvent</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">_KEYDOWN</span> <span class="o">&amp;&amp;</span> <span class="nx">p_oEvent</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">27</span><span class="o">))</span> <span class="o">{</span>

            <span class="c">/*  </span>
<span class="c">                Set the &quot;autosubmenudisplay&quot; to &quot;false&quot; if the user</span>
<span class="c">                clicks outside the menu bar.</span>
<span class="c">            */</span>

            <span class="nx">oTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">p_oEvent</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oTarget</span> <span class="o">!=</span> <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">element</span> <span class="o">||</span> <span class="o">!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">isAncestor</span><span class="o">(</span><span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oTarget</span><span class="o">))</span> <span class="o">{</span>

                <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_AUTO_SUBMENU_DISPLAY</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>

                <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="nx">_MOUSEDOWN</span><span class="o">,</span> <span class="nx">disableAutoSubmenuDisplay</span><span class="o">);</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="nx">_KEYDOWN</span><span class="o">,</span> <span class="nx">disableAutoSubmenuDisplay</span><span class="o">);</span>

            <span class="o">}</span>
        
        <span class="o">}</span>

    <span class="o">}</span>


	<span class="k">function</span> <span class="nx">onSubmenuHide</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_sWidth</span><span class="o">)</span> <span class="o">{</span>
	
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="nx">_EMPTY_STRING</span><span class="o">);</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="nx">onSubmenuHide</span><span class="o">,</span> <span class="nx">p_sWidth</span><span class="o">);</span>
	
	<span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oParent</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oParentMenu</span> <span class="o">=</span> <span class="nx">oParent</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>


        <span class="k">if</span> <span class="o">(!</span><span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_AUTO_SUBMENU_DISPLAY</span><span class="o">)</span> <span class="o">&amp;&amp;</span> 
            <span class="o">(</span><span class="nx">oParentMenu</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span> <span class="o">||</span> 
            <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_STATIC</span><span class="o">))</span> <span class="o">{</span>

            <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_AUTO_SUBMENU_DISPLAY</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="nx">_MOUSEDOWN</span><span class="o">,</span> <span class="nx">disableAutoSubmenuDisplay</span><span class="o">);</span>                             
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="nx">_KEYDOWN</span><span class="o">,</span> <span class="nx">disableAutoSubmenuDisplay</span><span class="o">);</span>

        <span class="o">}</span>


		<span class="c">//	The following fixes an issue with the selected state of a MenuItem </span>
<span class="c"></span>		<span class="c">//	not rendering correctly when a submenu is aligned to the left of</span>
<span class="c"></span>		<span class="c">//	its parent Menu instance.</span>
<span class="c"></span>
		<span class="k">if</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;x&quot;</span><span class="o">)</span> <span class="o">&lt;</span> <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;x&quot;</span><span class="o">))</span> <span class="o">&amp;&amp;</span> 
			<span class="o">(</span><span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&amp;&amp;</span> <span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&lt;</span> <span class="m">1</span><span class="o">.</span><span class="m">9</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">))</span> <span class="o">{</span>

			<span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>
			<span class="nx">nOffsetWidth</span> <span class="o">=</span> <span class="nx">oElement</span><span class="o">.</span><span class="nx">offsetWidth</span><span class="o">;</span>
			
			<span class="c">/*</span>
<span class="c">				Measuring the difference of the offsetWidth before and after</span>
<span class="c">				setting the &quot;width&quot; style attribute allows us to compute the </span>
<span class="c">				about of padding and borders applied to the element, which in </span>
<span class="c">				turn allows us to set the &quot;width&quot; property correctly.</span>
<span class="c">			*/</span>
			
			<span class="nx">oElement</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">nOffsetWidth</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">;</span>
			
			<span class="nx">sWidth</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nOffsetWidth</span> <span class="o">-</span> <span class="o">(</span><span class="nx">oElement</span><span class="o">.</span><span class="nx">offsetWidth</span> <span class="o">-</span> <span class="nx">nOffsetWidth</span><span class="o">))</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">;</span>
			
			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="nx">sWidth</span><span class="o">);</span>
		
			<span class="k">this</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">onSubmenuHide</span><span class="o">,</span> <span class="nx">sWidth</span><span class="o">);</span>
		
		<span class="o">}</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onBeforeHide</span>
<span class="c">* @description &quot;beforehide&quot; event handler for the menu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">*/</span>
<span class="nx">_onBeforeHide</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oActiveItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">,</span>
        <span class="nx">oRoot</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">(),</span>
        <span class="nx">oConfig</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oActiveItem</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oConfig</span> <span class="o">=</span> <span class="nx">oActiveItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>

        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>

        <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>

        <span class="o">}</span>

    <span class="o">}</span>


	<span class="c">/*</span>
<span class="c">		Focus can get lost in IE when the mouse is moving from a submenu back to its parent Menu.  </span>
<span class="c">		For this reason, it is necessary to maintain the focused state in a private property </span>
<span class="c">		so that the _onMouseOver event handler is able to determined whether or not to set focus</span>
<span class="c">		to MenuItems as the user is moving the mouse.</span>
<span class="c">	*/</span> 

	<span class="k">if</span> <span class="o">(</span><span class="nx">UA</span><span class="o">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">===</span> <span class="nx">_DYNAMIC</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>

		<span class="nx">oRoot</span><span class="o">.</span><span class="nx">_hasFocus</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">hasFocus</span><span class="o">();</span>
	
	<span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oRoot</span> <span class="o">==</span> <span class="k">this</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oRoot</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onParentMenuConfigChange</span>
<span class="c">* @description &quot;configchange&quot; event handler for a submenu.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that </span>
<span class="c">* subscribed to the event.</span>
<span class="c">*/</span>
<span class="nx">_onParentMenuConfigChange</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oSubmenu</span><span class="o">)</span> <span class="o">{</span>
    
    <span class="k">var</span> <span class="nx">sPropertyName</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">][</span><span class="m">0</span><span class="o">],</span>
        <span class="nx">oPropertyValue</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">][</span><span class="m">1</span><span class="o">];</span>

    <span class="nx">switch</span><span class="o">(</span><span class="nx">sPropertyName</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">case</span> <span class="nx">_IFRAME</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_CONSTRAIN_TO_VIEWPORT</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_HIDE_DELAY</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_SHOW_DELAY</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_SUBMENU_HIDE_DELAY</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_CLICK_TO_HIDE</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_EFFECT</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_CLASSNAME</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_SCROLL_INCREMENT</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_MAX_HEIGHT</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_MONITOR_RESIZE</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_SHADOW</span><span class="o">:</span>
        <span class="nx">case</span> <span class="nx">_PREVENT_CONTEXT_OVERLAP</span><span class="o">:</span>

            <span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">sPropertyName</span><span class="o">,</span> <span class="nx">oPropertyValue</span><span class="o">);</span>
                
        <span class="k">break</span><span class="o">;</span>
        
        <span class="nx">case</span> <span class="nx">_SUBMENU_ALIGNMENT</span><span class="o">:</span>

			<span class="k">if</span> <span class="o">(!(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">parent</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">))</span> <span class="o">{</span>
		
				<span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">sPropertyName</span><span class="o">,</span> <span class="nx">oPropertyValue</span><span class="o">);</span>
		
			<span class="o">}</span>
        
        <span class="k">break</span><span class="o">;</span>
        
    <span class="o">}</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onParentMenuRender</span>
<span class="c">* @description &quot;render&quot; event handler for a submenu.  Renders a  </span>
<span class="c">* submenu in response to the firing of its parent&#39;s &quot;render&quot; event.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that </span>
<span class="c">* subscribed to the event.</span>
<span class="c">*/</span>
<span class="nx">_onParentMenuRender</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oSubmenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oParentMenu</span> <span class="o">=</span> <span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
    	<span class="nx">oParentCfg</span> <span class="o">=</span> <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>

        <span class="nx">oConfig</span> <span class="o">=</span> <span class="o">{</span>

            <span class="nx">constraintoviewport</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_CONSTRAIN_TO_VIEWPORT</span><span class="o">),</span>

            <span class="nx">xy</span><span class="o">:</span> <span class="o">[</span><span class="m">0</span><span class="o">,</span><span class="m">0</span><span class="o">],</span>

            <span class="nx">clicktohide</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_CLICK_TO_HIDE</span><span class="o">),</span>
                
            <span class="nx">effect</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_EFFECT</span><span class="o">),</span>

            <span class="nx">showdelay</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SHOW_DELAY</span><span class="o">),</span>
            
            <span class="nx">hidedelay</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_HIDE_DELAY</span><span class="o">),</span>

            <span class="nx">submenuhidedelay</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU_HIDE_DELAY</span><span class="o">),</span>

            <span class="nx">classname</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_CLASSNAME</span><span class="o">),</span>
            
            <span class="nx">scrollincrement</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SCROLL_INCREMENT</span><span class="o">),</span>
            
			<span class="nx">maxheight</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MAX_HEIGHT</span><span class="o">),</span>

            <span class="nx">minscrollheight</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">),</span>
            
            <span class="nx">iframe</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_IFRAME</span><span class="o">),</span>
            
            <span class="nx">shadow</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SHADOW</span><span class="o">),</span>

			<span class="nx">preventcontextoverlap</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_PREVENT_CONTEXT_OVERLAP</span><span class="o">),</span>
            
            <span class="nx">monitorresize</span><span class="o">:</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MONITOR_RESIZE</span><span class="o">)</span>

        <span class="o">},</span>
        
        <span class="nx">oLI</span><span class="o">;</span>


	
	<span class="k">if</span> <span class="o">(!(</span><span class="nx">oParentMenu</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuBar</span><span class="o">))</span> <span class="o">{</span>

		<span class="nx">oConfig</span><span class="o">[</span><span class="nx">_SUBMENU_ALIGNMENT</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oParentCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU_ALIGNMENT</span><span class="o">);</span>

	<span class="o">}</span>


    <span class="nx">p_oSubmenu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">applyConfig</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">);</span>


    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">lazyLoad</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oLI</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">parentNode</span> <span class="o">==</span> <span class="nx">oLI</span><span class="o">)</span> <span class="o">{</span>
    
            <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">();</span>
    
        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">(</span><span class="nx">oLI</span><span class="o">);</span>
    
        <span class="o">}</span>

    <span class="o">}</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onMenuItemDestroy</span>
<span class="c">* @description &quot;destroy&quot; event handler for the menu&#39;s items.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event </span>
<span class="c">* that was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item </span>
<span class="c">* that fired the event.</span>
<span class="c">*/</span>
<span class="nx">_onMenuItemDestroy</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">_removeItemFromGroupByValue</span><span class="o">(</span><span class="nx">p_oItem</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onMenuItemConfigChange</span>
<span class="c">* @description &quot;configchange&quot; event handler for the menu&#39;s items.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item </span>
<span class="c">* that fired the event.</span>
<span class="c">*/</span>
<span class="nx">_onMenuItemConfigChange</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">sPropertyName</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">][</span><span class="m">0</span><span class="o">],</span>
        <span class="nx">oPropertyValue</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">][</span><span class="m">1</span><span class="o">],</span>
        <span class="nx">oSubmenu</span><span class="o">;</span>


    <span class="nx">switch</span><span class="o">(</span><span class="nx">sPropertyName</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">case</span> <span class="nx">_SELECTED</span><span class="o">:</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oPropertyValue</span> <span class="o">===</span> <span class="kc">true</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span> <span class="o">=</span> <span class="nx">p_oItem</span><span class="o">;</span>
            
            <span class="o">}</span>

        <span class="k">break</span><span class="o">;</span>

        <span class="nx">case</span> <span class="nx">_SUBMENU</span><span class="o">:</span>

            <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">][</span><span class="m">1</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">this</span><span class="o">.</span><span class="nx">_configureSubmenu</span><span class="o">(</span><span class="nx">p_oItem</span><span class="o">);</span>

            <span class="o">}</span>

        <span class="k">break</span><span class="o">;</span>

    <span class="o">}</span>

<span class="o">},</span>



<span class="c">// Public event handlers for configuration properties</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @method configVisible</span>
<span class="c">* @description Event handler for when the &quot;visible&quot; configuration property </span>
<span class="c">* the menu changes.</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">configVisible</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">bVisible</span><span class="o">,</span>
        <span class="nx">sDisplay</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">configVisible</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">);</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>

        <span class="nx">bVisible</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
        <span class="nx">sDisplay</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_DISPLAY</span><span class="o">);</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_VISIBILITY</span><span class="o">,</span> <span class="nx">_VISIBLE</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">bVisible</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">sDisplay</span> <span class="o">!=</span> <span class="nx">_BLOCK</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">beforeShowEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_DISPLAY</span><span class="o">,</span> <span class="nx">_BLOCK</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">showEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
            <span class="o">}</span>
        
        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">sDisplay</span> <span class="o">==</span> <span class="nx">_BLOCK</span><span class="o">)</span> <span class="o">{</span>
				<span class="k">this</span><span class="o">.</span><span class="nx">beforeHideEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
				<span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_DISPLAY</span><span class="o">,</span> <span class="nx">_NONE</span><span class="o">);</span>
				<span class="k">this</span><span class="o">.</span><span class="nx">hideEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
			<span class="o">}</span>
        
        <span class="o">}</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configPosition</span>
<span class="c">* @description Event handler for when the &quot;position&quot; configuration property </span>
<span class="c">* of the menu changes.</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">configPosition</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
        <span class="nx">sCSSPosition</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">==</span> <span class="nx">_STATIC</span> <span class="o">?</span> <span class="nx">_STATIC</span> <span class="o">:</span> <span class="nx">_ABSOLUTE</span><span class="o">,</span>
        <span class="nx">oCfg</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">,</span>
        <span class="nx">nZIndex</span><span class="o">;</span>


    <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">oElement</span><span class="o">,</span> <span class="nx">_POSITION</span><span class="o">,</span> <span class="nx">sCSSPosition</span><span class="o">);</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">sCSSPosition</span> <span class="o">==</span> <span class="nx">_STATIC</span><span class="o">)</span> <span class="o">{</span>

        <span class="c">// Statically positioned menus are visible by default</span>
<span class="c"></span>        
        <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">oElement</span><span class="o">,</span> <span class="nx">_DISPLAY</span><span class="o">,</span> <span class="nx">_BLOCK</span><span class="o">);</span>

        <span class="nx">oCfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_VISIBLE</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>

        <span class="c">/*</span>
<span class="c">            Even though the &quot;visible&quot; property is queued to </span>
<span class="c">            &quot;false&quot; by default, we need to set the &quot;visibility&quot; property to </span>
<span class="c">            &quot;hidden&quot; since Overlay&#39;s &quot;configVisible&quot; implementation checks the </span>
<span class="c">            element&#39;s &quot;visibility&quot; style property before deciding whether </span>
<span class="c">            or not to show an Overlay instance.</span>
<span class="c">        */</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">oElement</span><span class="o">,</span> <span class="nx">_VISIBILITY</span><span class="o">,</span> <span class="nx">_HIDDEN</span><span class="o">);</span>
    
    <span class="o">}</span>

  	 
     <span class="k">if</span> <span class="o">(</span><span class="nx">sCSSPosition</span> <span class="o">==</span> <span class="nx">_ABSOLUTE</span><span class="o">)</span> <span class="o">{</span> 	 
  	 
         <span class="nx">nZIndex</span> <span class="o">=</span> <span class="nx">oCfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_ZINDEX</span><span class="o">);</span>
  	 
         <span class="k">if</span> <span class="o">(!</span><span class="nx">nZIndex</span> <span class="o">||</span> <span class="nx">nZIndex</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span> 	 
  	 
             <span class="nx">oCfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_ZINDEX</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span> 	 
  	 
         <span class="o">}</span> 	 
  	 
     <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configIframe</span>
<span class="c">* @description Event handler for when the &quot;iframe&quot; configuration property of </span>
<span class="c">* the menu changes.</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">configIframe</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>    

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">configIframe</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">);</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configHideDelay</span>
<span class="c">* @description Event handler for when the &quot;hidedelay&quot; configuration property </span>
<span class="c">* of the menu changes.</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">configHideDelay</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nHideDelay</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">_useHideDelay</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nHideDelay</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configContainer</span>
<span class="c">* @description Event handler for when the &quot;container&quot; configuration property </span>
<span class="c">* of the menu changes.</span>
<span class="c">* @param {String} p_sType String representing the name of the event that </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Array} p_aArgs Array of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that </span>
<span class="c">* fired the event.</span>
<span class="c">*/</span>
<span class="nx">configContainer</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">oElement</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">oElement</span><span class="o">))</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_CONTAINER</span><span class="o">,</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">oElement</span><span class="o">),</span> <span class="kc">true</span><span class="o">);</span>

	<span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _clearSetWidthFlag</span>
<span class="c">* @description Change event listener for the &quot;width&quot; configuration property.  This listener is </span>
<span class="c">* added when a Menu&#39;s &quot;width&quot; configuration property is set by the &quot;_setScrollHeight&quot; method, and </span>
<span class="c">* is used to set the &quot;_widthSetForScroll&quot; property to &quot;false&quot; if the &quot;width&quot; configuration property </span>
<span class="c">* is changed after it was set by the &quot;_setScrollHeight&quot; method.  If the &quot;_widthSetForScroll&quot; </span>
<span class="c">* property is set to &quot;false&quot;, and the &quot;_setScrollHeight&quot; method is in the process of tearing down </span>
<span class="c">* scrolling functionality, it will maintain the Menu&#39;s new width rather than reseting it.</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_clearSetWidthFlag</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">_widthSetForScroll</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">unsubscribeFromConfigEvent</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_clearSetWidthFlag</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _setScrollHeight</span>
<span class="c">* @description </span>
<span class="c">* @param {String} p_nScrollHeight Number representing the scrolling height of the Menu.</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_setScrollHeight</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nScrollHeight</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nScrollHeight</span> <span class="o">=</span> <span class="nx">p_nScrollHeight</span><span class="o">,</span>
		<span class="nx">bRefireIFrameAndShadow</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
		<span class="nx">bSetWidth</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
        <span class="nx">oElement</span><span class="o">,</span>
        <span class="nx">oBody</span><span class="o">,</span>
        <span class="nx">oHeader</span><span class="o">,</span>
        <span class="nx">oFooter</span><span class="o">,</span>
        <span class="nx">fnMouseOver</span><span class="o">,</span>
        <span class="nx">fnMouseOut</span><span class="o">,</span>
        <span class="nx">nMinScrollHeight</span><span class="o">,</span>
        <span class="nx">nHeight</span><span class="o">,</span>
        <span class="nx">nOffsetWidth</span><span class="o">,</span>
        <span class="nx">sWidth</span><span class="o">;</span>


	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">().</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
	
        <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>
        <span class="nx">oBody</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">body</span><span class="o">;</span>
        <span class="nx">oHeader</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">header</span><span class="o">;</span>
        <span class="nx">oFooter</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">footer</span><span class="o">;</span>
        <span class="nx">fnMouseOver</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onScrollTargetMouseOver</span><span class="o">;</span>
        <span class="nx">fnMouseOut</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onScrollTargetMouseOut</span><span class="o">;</span>
        <span class="nx">nMinScrollHeight</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_MIN_SCROLL_HEIGHT</span><span class="o">);</span>


		<span class="k">if</span> <span class="o">(</span><span class="nx">nScrollHeight</span> <span class="o">&gt;</span> <span class="m">0</span> <span class="o">&amp;&amp;</span> <span class="nx">nScrollHeight</span> <span class="o">&lt;</span> <span class="nx">nMinScrollHeight</span><span class="o">)</span> <span class="o">{</span>
		
			<span class="nx">nScrollHeight</span> <span class="o">=</span> <span class="nx">nMinScrollHeight</span><span class="o">;</span>
		
		<span class="o">}</span>


		<span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">oBody</span><span class="o">,</span> <span class="nx">_HEIGHT</span><span class="o">,</span> <span class="nx">_EMPTY_STRING</span><span class="o">);</span>
		<span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">oBody</span><span class="o">,</span> <span class="nx">_YUI_MENU_BODY_SCROLLED</span><span class="o">);</span>
		<span class="nx">oBody</span><span class="o">.</span><span class="nx">scrollTop</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>


		<span class="c">//	Need to set a width for the Menu to fix the following problems in </span>
<span class="c"></span>		<span class="c">//	Firefox 2 and IE:</span>
<span class="c"></span>
		<span class="c">//	#1) Scrolled Menus will render at 1px wide in Firefox 2</span>
<span class="c"></span>
		<span class="c">//	#2) There is a bug in gecko-based browsers where an element whose </span>
<span class="c"></span>		<span class="c">//	&quot;position&quot; property is set to &quot;absolute&quot; and &quot;overflow&quot; property is </span>
<span class="c"></span>		<span class="c">//	set to &quot;hidden&quot; will not render at the correct width when its </span>
<span class="c"></span>		<span class="c">//	offsetParent&#39;s &quot;position&quot; property is also set to &quot;absolute.&quot;  It is </span>
<span class="c"></span>		<span class="c">//	possible to work around this bug by specifying a value for the width </span>
<span class="c"></span>		<span class="c">//	property in addition to overflow.</span>
<span class="c"></span>
		<span class="c">//	#3) In IE it is necessary to give the Menu a width before the </span>
<span class="c"></span>		<span class="c">//	scrollbars are rendered to prevent the Menu from rendering with a </span>
<span class="c"></span>		<span class="c">//	width that is 100% of the browser viewport.</span>
<span class="c"></span>	
		<span class="nx">bSetWidth</span> <span class="o">=</span> <span class="o">((</span><span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&amp;&amp;</span> <span class="nx">UA</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">&lt;</span> <span class="m">1</span><span class="o">.</span><span class="m">9</span><span class="o">)</span> <span class="o">||</span> <span class="nx">UA</span><span class="o">.</span><span class="nx">ie</span><span class="o">);</span>

		<span class="k">if</span> <span class="o">(</span><span class="nx">nScrollHeight</span> <span class="o">&gt;</span> <span class="m">0</span> <span class="o">&amp;&amp;</span> <span class="nx">bSetWidth</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">))</span> <span class="o">{</span>

			<span class="nx">nOffsetWidth</span> <span class="o">=</span> <span class="nx">oElement</span><span class="o">.</span><span class="nx">offsetWidth</span><span class="o">;</span>
	
			<span class="c">/*</span>
<span class="c">				Measuring the difference of the offsetWidth before and after</span>
<span class="c">				setting the &quot;width&quot; style attribute allows us to compute the </span>
<span class="c">				about of padding and borders applied to the element, which in </span>
<span class="c">				turn allows us to set the &quot;width&quot; property correctly.</span>
<span class="c">			*/</span>
			
			<span class="nx">oElement</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">nOffsetWidth</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">;</span>
	
			<span class="nx">sWidth</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nOffsetWidth</span> <span class="o">-</span> <span class="o">(</span><span class="nx">oElement</span><span class="o">.</span><span class="nx">offsetWidth</span> <span class="o">-</span> <span class="nx">nOffsetWidth</span><span class="o">))</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">;</span>


			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">unsubscribeFromConfigEvent</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_clearSetWidthFlag</span><span class="o">);</span>

			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Setting the \&quot;width\&quot; configuration property to &quot;</span> <span class="o">+</span> <span class="nx">sWidth</span> <span class="o">+</span> <span class="s2">&quot; for srolling.&quot;</span><span class="o">,</span> 
				<span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="nx">sWidth</span><span class="o">);</span>


			<span class="c">/*</span>
<span class="c">				Set a flag (_widthSetForScroll) to maintain some history regarding how the </span>
<span class="c">				&quot;width&quot; configuration property was set.  If the &quot;width&quot; configuration property </span>
<span class="c">				is set by something other than the &quot;_setScrollHeight&quot; method, it will be </span>
<span class="c">				necessary to maintain that new value and not clear the width if scrolling </span>
<span class="c">				is turned off.</span>
<span class="c">			*/</span>

			<span class="k">this</span><span class="o">.</span><span class="nx">_widthSetForScroll</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_clearSetWidthFlag</span><span class="o">);</span>
	
		<span class="o">}</span>
	
	
		<span class="k">if</span> <span class="o">(</span><span class="nx">nScrollHeight</span> <span class="o">&gt;</span> <span class="m">0</span> <span class="o">&amp;&amp;</span> <span class="o">(!</span><span class="nx">oHeader</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oFooter</span><span class="o">))</span> <span class="o">{</span>
	
			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Creating header and footer for scrolling.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">setHeader</span><span class="o">(</span><span class="nx">_NON_BREAKING_SPACE</span><span class="o">);</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">setFooter</span><span class="o">(</span><span class="nx">_NON_BREAKING_SPACE</span><span class="o">);</span>
	
			<span class="nx">oHeader</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">header</span><span class="o">;</span>
			<span class="nx">oFooter</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">footer</span><span class="o">;</span>
	
			<span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">,</span> <span class="nx">_TOP_SCROLLBAR</span><span class="o">);</span>
			<span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">,</span> <span class="nx">_BOTTOM_SCROLLBAR</span><span class="o">);</span>
			
			<span class="nx">oElement</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">,</span> <span class="nx">oBody</span><span class="o">);</span>
			<span class="nx">oElement</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">);</span>
		
		<span class="o">}</span>
	
	
		<span class="nx">nHeight</span> <span class="o">=</span> <span class="nx">nScrollHeight</span><span class="o">;</span>
	
	
		<span class="k">if</span> <span class="o">(</span><span class="nx">oHeader</span> <span class="o">&amp;&amp;</span> <span class="nx">oFooter</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">nHeight</span> <span class="o">=</span> <span class="o">(</span><span class="nx">nHeight</span> <span class="o">-</span> <span class="o">(</span><span class="nx">oHeader</span><span class="o">.</span><span class="nx">offsetHeight</span> <span class="o">+</span> <span class="nx">oFooter</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">));</span>
		<span class="o">}</span>
	
	
		<span class="k">if</span> <span class="o">((</span><span class="nx">nHeight</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">oBody</span><span class="o">.</span><span class="nx">offsetHeight</span> <span class="o">&gt;</span> <span class="nx">nScrollHeight</span><span class="o">))</span> <span class="o">{</span>

			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Setting up styles and event handlers for scrolling.&quot;</span><span class="o">,</span> 
				<span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
	
			<span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">oBody</span><span class="o">,</span> <span class="nx">_YUI_MENU_BODY_SCROLLED</span><span class="o">);</span>
			<span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">oBody</span><span class="o">,</span> <span class="nx">_HEIGHT</span><span class="o">,</span> <span class="o">(</span><span class="nx">nHeight</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">));</span>

			<span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasScrollEventHandlers</span><span class="o">)</span> <span class="o">{</span>
	
				<span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">,</span> <span class="nx">_MOUSEOVER</span><span class="o">,</span> <span class="nx">fnMouseOver</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
				<span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">,</span> <span class="nx">_MOUSEOUT</span><span class="o">,</span> <span class="nx">fnMouseOut</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
				<span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">,</span> <span class="nx">_MOUSEOVER</span><span class="o">,</span> <span class="nx">fnMouseOver</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
				<span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">,</span> <span class="nx">_MOUSEOUT</span><span class="o">,</span> <span class="nx">fnMouseOut</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	
				<span class="k">this</span><span class="o">.</span><span class="nx">_hasScrollEventHandlers</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
	
			<span class="o">}</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">_disableScrollHeader</span><span class="o">();</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollFooter</span><span class="o">();</span>
			
			<span class="nx">bRefireIFrameAndShadow</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>			
	
		<span class="o">}</span>
		<span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">oHeader</span> <span class="o">&amp;&amp;</span> <span class="nx">oFooter</span><span class="o">)</span> <span class="o">{</span>

			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Removing styles and event handlers for scrolling.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
	

			<span class="c">/*</span>
<span class="c">				Only clear the the &quot;width&quot; configuration property if it was set the </span>
<span class="c">				&quot;_setScrollHeight&quot; method and wasn&#39;t changed by some other means after it was set.</span>
<span class="c">			*/</span>	
	
			<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_widthSetForScroll</span><span class="o">)</span> <span class="o">{</span>
	
				<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Clearing width used for scrolling.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

				<span class="k">this</span><span class="o">.</span><span class="nx">_widthSetForScroll</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

				<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">unsubscribeFromConfigEvent</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_clearSetWidthFlag</span><span class="o">);</span>
	
				<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="nx">_EMPTY_STRING</span><span class="o">);</span>
			
			<span class="o">}</span>
	
	
			<span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollHeader</span><span class="o">();</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">_enableScrollFooter</span><span class="o">();</span>
	
			<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasScrollEventHandlers</span><span class="o">)</span> <span class="o">{</span>
	
				<span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">,</span> <span class="nx">_MOUSEOVER</span><span class="o">,</span> <span class="nx">fnMouseOver</span><span class="o">);</span>
				<span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">,</span> <span class="nx">_MOUSEOUT</span><span class="o">,</span> <span class="nx">fnMouseOut</span><span class="o">);</span>
				<span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">,</span> <span class="nx">_MOUSEOVER</span><span class="o">,</span> <span class="nx">fnMouseOver</span><span class="o">);</span>
				<span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">,</span> <span class="nx">_MOUSEOUT</span><span class="o">,</span> <span class="nx">fnMouseOut</span><span class="o">);</span>

				<span class="k">this</span><span class="o">.</span><span class="nx">_hasScrollEventHandlers</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
	
			<span class="o">}</span>

			<span class="nx">oElement</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">);</span>
			<span class="nx">oElement</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">);</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">header</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">footer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
			
			<span class="nx">bRefireIFrameAndShadow</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
		
		<span class="o">}</span>


		<span class="k">if</span> <span class="o">(</span><span class="nx">bRefireIFrameAndShadow</span><span class="o">)</span> <span class="o">{</span>
	
			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">_IFRAME</span><span class="o">);</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">_SHADOW</span><span class="o">);</span>
		
		<span class="o">}</span>
	
	<span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _setMaxHeight</span>
<span class="c">* @description &quot;renderEvent&quot; handler used to defer the setting of the </span>
<span class="c">* &quot;maxheight&quot; configuration property until the menu is rendered in lazy </span>
<span class="c">* load scenarios.</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event </span>
<span class="c">* was fired.</span>
<span class="c">* @param {Number} p_nMaxHeight Number representing the value to set for the </span>
<span class="c">* &quot;maxheight&quot; configuration property.</span>
<span class="c">* @private</span>
<span class="c">*/</span>
<span class="nx">_setMaxHeight</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_nMaxHeight</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">_setScrollHeight</span><span class="o">(</span><span class="nx">p_nMaxHeight</span><span class="o">);</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_setMaxHeight</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configMaxHeight</span>
<span class="c">* @description Event handler for when the &quot;maxheight&quot; configuration property of </span>
<span class="c">* a Menu changes.</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event </span>
<span class="c">* was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired</span>
<span class="c">* the event.</span>
<span class="c">*/</span>
<span class="nx">configMaxHeight</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">nMaxHeight</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">lazyLoad</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">body</span> <span class="o">&amp;&amp;</span> <span class="nx">nMaxHeight</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
	
		<span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_setMaxHeight</span><span class="o">,</span> <span class="nx">nMaxHeight</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

	<span class="o">}</span>
	<span class="k">else</span> <span class="o">{</span>

		<span class="k">this</span><span class="o">.</span><span class="nx">_setScrollHeight</span><span class="o">(</span><span class="nx">nMaxHeight</span><span class="o">);</span>
	
	<span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configClassName</span>
<span class="c">* @description Event handler for when the &quot;classname&quot; configuration property of </span>
<span class="c">* a menu changes.</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.</span>
<span class="c">*/</span>
<span class="nx">configClassName</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">sClassName</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_sClassName</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sClassName</span><span class="o">);</span>

    <span class="o">}</span>

    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">sClassName</span><span class="o">);</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_sClassName</span> <span class="o">=</span> <span class="nx">sClassName</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method _onItemAdded</span>
<span class="c">* @description &quot;itemadded&quot; event handler for a Menu instance.</span>
<span class="c">* @private</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event </span>
<span class="c">* was fired.</span>
<span class="c">*/</span>
<span class="nx">_onItemAdded</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
    
    <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configDisabled</span>
<span class="c">* @description Event handler for when the &quot;disabled&quot; configuration property of </span>
<span class="c">* a menu changes.</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.</span>
<span class="c">*/</span>
<span class="nx">configDisabled</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">bDisabled</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
        <span class="nx">aItems</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">(),</span>
        <span class="nx">nItems</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">aItems</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
    
        <span class="k">if</span> <span class="o">(</span><span class="nx">nItems</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
        
            <span class="nx">i</span> <span class="o">=</span> <span class="nx">nItems</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>
    
            <span class="k">do</span> <span class="o">{</span>
    
                <span class="nx">aItems</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_DISABLED</span><span class="o">,</span> <span class="nx">bDisabled</span><span class="o">);</span>
            
            <span class="o">}</span>
            <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>
        
        <span class="o">}</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">bDisabled</span><span class="o">)</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">clearActiveItem</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>

            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_DISABLED</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">itemAddedEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onItemAdded</span><span class="o">);</span>

        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">_DISABLED</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">itemAddedEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onItemAdded</span><span class="o">);</span>

        <span class="o">}</span>
        
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method configShadow</span>
<span class="c">* @description Event handler for when the &quot;shadow&quot; configuration property of </span>
<span class="c">* a menu changes.</span>
<span class="c">* @param {String} p_sType The name of the event that was fired.</span>
<span class="c">* @param {Array} p_aArgs Collection of arguments sent when the event was fired.</span>
<span class="c">* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.</span>
<span class="c">*/</span>
<span class="nx">configShadow</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oMenu</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">sizeShadow</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
            <span class="nx">oShadow</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">;</span>
    
        <span class="k">if</span> <span class="o">(</span><span class="nx">oShadow</span> <span class="o">&amp;&amp;</span> <span class="nx">oElement</span><span class="o">)</span> <span class="o">{</span>

			<span class="c">// Clear the previous width</span>
<span class="c"></span>
			<span class="k">if</span> <span class="o">(</span><span class="nx">oShadow</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">&amp;&amp;</span> <span class="nx">oShadow</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span><span class="o">)</span> <span class="o">{</span>
			
				<span class="nx">oShadow</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">_EMPTY_STRING</span><span class="o">;</span>
				<span class="nx">oShadow</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">_EMPTY_STRING</span><span class="o">;</span>
			
			<span class="o">}</span>

            <span class="nx">oShadow</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="o">(</span><span class="nx">oElement</span><span class="o">.</span><span class="nx">offsetWidth</span> <span class="o">+</span> <span class="m">6</span><span class="o">)</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">;</span>
            <span class="nx">oShadow</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="o">(</span><span class="nx">oElement</span><span class="o">.</span><span class="nx">offsetHeight</span> <span class="o">+</span> <span class="m">1</span><span class="o">)</span> <span class="o">+</span> <span class="nx">_PX</span><span class="o">;</span>
            
        <span class="o">}</span>
    
    <span class="o">};</span>


    <span class="k">var</span> <span class="nx">replaceShadow</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">);</span>

    <span class="o">};</span>


    <span class="k">var</span> <span class="nx">addShadowVisibleClass</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
    
        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">,</span> <span class="nx">_YUI_MENU_SHADOW_VISIBLE</span><span class="o">);</span>
    
    <span class="o">};</span>
    

    <span class="k">var</span> <span class="nx">removeShadowVisibleClass</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">,</span> <span class="nx">_YUI_MENU_SHADOW_VISIBLE</span><span class="o">);</span>
    
    <span class="o">};</span>


    <span class="k">var</span> <span class="nx">createShadow</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">oShadow</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">,</span>
            <span class="nx">oElement</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">oShadow</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>


            <span class="k">if</span> <span class="o">(!</span><span class="nx">m_oShadowTemplate</span><span class="o">)</span> <span class="o">{</span>

                <span class="nx">m_oShadowTemplate</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="nx">_DIV_LOWERCASE</span><span class="o">);</span>
                <span class="nx">m_oShadowTemplate</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">_YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE</span><span class="o">;</span>
            
            <span class="o">}</span>

            <span class="nx">oShadow</span> <span class="o">=</span> <span class="nx">m_oShadowTemplate</span><span class="o">.</span><span class="nx">cloneNode</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>

            <span class="nx">oElement</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oShadow</span><span class="o">);</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span> <span class="o">=</span> <span class="nx">oShadow</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">beforeShowEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">addShadowVisibleClass</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">beforeHideEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">removeShadowVisibleClass</span><span class="o">);</span>


            <span class="k">if</span> <span class="o">(</span><span class="nx">UA</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
        
                <span class="c">/*</span>
<span class="c">                     Need to call sizeShadow &amp; syncIframe via setTimeout for </span>
<span class="c">                     IE 7 Quirks Mode and IE 6 Standards Mode and Quirks Mode </span>
<span class="c">                     or the shadow and iframe shim will not be sized and </span>
<span class="c">                     positioned properly.</span>
<span class="c">                */</span>
        
				<span class="nx">Lang</span><span class="o">.</span><span class="nx">later</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

                    <span class="nx">sizeShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span> 
                    <span class="k">this</span><span class="o">.</span><span class="nx">syncIframe</span><span class="o">();</span>
				
				<span class="o">});</span>


                <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="nx">sizeShadow</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_HEIGHT</span><span class="o">,</span> <span class="nx">sizeShadow</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_MAX_HEIGHT</span><span class="o">,</span> <span class="nx">sizeShadow</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">changeContentEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">sizeShadow</span><span class="o">);</span>

                <span class="nx">Module</span><span class="o">.</span><span class="nx">textResizeEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">sizeShadow</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                
                <span class="k">this</span><span class="o">.</span><span class="nx">destroyEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
                
                    <span class="nx">Module</span><span class="o">.</span><span class="nx">textResizeEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="nx">sizeShadow</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                
                <span class="o">});</span>
        
            <span class="o">}</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_MAX_HEIGHT</span><span class="o">,</span> <span class="nx">replaceShadow</span><span class="o">);</span>

        <span class="o">}</span>

    <span class="o">};</span>


    <span class="k">var</span> <span class="nx">onBeforeShow</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">)</span> <span class="o">{</span>

			<span class="c">// If called because the &quot;shadow&quot; event was refired - just append again and resize</span>
<span class="c"></span>			
			<span class="nx">replaceShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
			
			<span class="k">if</span> <span class="o">(</span><span class="nx">UA</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">sizeShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
			<span class="o">}</span>
    	
    	<span class="o">}</span>
    	<span class="k">else</span> <span class="o">{</span>
    
        	<span class="nx">createShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
        
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">beforeShowEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="nx">onBeforeShow</span><span class="o">);</span>
    
    <span class="o">};</span>


	<span class="k">var</span> <span class="nx">bShadow</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">bShadow</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_POSITION</span><span class="o">)</span> <span class="o">==</span> <span class="nx">_DYNAMIC</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_VISIBLE</span><span class="o">))</span> <span class="o">{</span>

			<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_shadow</span><span class="o">)</span> <span class="o">{</span>

				<span class="c">// If the &quot;shadow&quot; event was refired - just append again and resize</span>
<span class="c"></span>				
				<span class="nx">replaceShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
				
				<span class="k">if</span> <span class="o">(</span><span class="nx">UA</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">sizeShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
				<span class="o">}</span>
				
			<span class="o">}</span> 
			<span class="k">else</span> <span class="o">{</span>
            	<span class="nx">createShadow</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
            <span class="o">}</span>
        
        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">beforeShowEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">onBeforeShow</span><span class="o">);</span>
        
        <span class="o">}</span>
    
    <span class="o">}</span>
    
<span class="o">},</span>



<span class="c">// Public methods</span>
<span class="c"></span>

<span class="c">/**</span>
<span class="c">* @method initEvents</span>
<span class="c">* @description Initializes the custom events for the menu.</span>
<span class="c">*/</span>
<span class="nx">initEvents</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

	<span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">initEvents</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>

    <span class="c">// Create custom events</span>
<span class="c"></span>
	<span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">EVENT_TYPES</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">,</span>
		<span class="nx">aEventData</span><span class="o">,</span>
		<span class="nx">oCustomEvent</span><span class="o">;</span>


	<span class="k">do</span> <span class="o">{</span>

		<span class="nx">aEventData</span> <span class="o">=</span> <span class="nx">EVENT_TYPES</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

		<span class="nx">oCustomEvent</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="nx">aEventData</span><span class="o">[</span><span class="m">1</span><span class="o">]);</span>
		<span class="nx">oCustomEvent</span><span class="o">.</span><span class="nx">signature</span> <span class="o">=</span> <span class="nx">CustomEvent</span><span class="o">.</span><span class="nx">LIST</span><span class="o">;</span>
		
		<span class="k">this</span><span class="o">[</span><span class="nx">aEventData</span><span class="o">[</span><span class="m">0</span><span class="o">]]</span> <span class="o">=</span> <span class="nx">oCustomEvent</span><span class="o">;</span>

	<span class="o">}</span>
	<span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method positionOffScreen</span>
<span class="c">* @description Positions the menu outside of the boundaries of the browser&#39;s </span>
<span class="c">* viewport.  Called automatically when a menu is hidden to ensure that </span>
<span class="c">* it doesn&#39;t force the browser to render uncessary scrollbars.</span>
<span class="c">*/</span>
<span class="nx">positionOffScreen</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oIFrame</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">,</span>
    	<span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
        <span class="nx">sPos</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">OFF_SCREEN_POSITION</span><span class="o">;</span>
    
    <span class="nx">oElement</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="nx">_EMPTY_STRING</span><span class="o">;</span>
    <span class="nx">oElement</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">_EMPTY_STRING</span><span class="o">;</span>
    
    <span class="k">if</span> <span class="o">(</span><span class="nx">oIFrame</span><span class="o">)</span> <span class="o">{</span>

		<span class="nx">oIFrame</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="nx">sPos</span><span class="o">;</span>
		<span class="nx">oIFrame</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">sPos</span><span class="o">;</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method getRoot</span>
<span class="c">* @description Finds the menu&#39;s root menu.</span>
<span class="c">*/</span>
<span class="nx">getRoot</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">,</span>
        <span class="nx">oParentMenu</span><span class="o">,</span>
        <span class="nx">returnVal</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oParentMenu</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>

        <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">oParentMenu</span> <span class="o">?</span> <span class="nx">oParentMenu</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">()</span> <span class="o">:</span> <span class="k">this</span><span class="o">;</span>

    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>
    
        <span class="nx">returnVal</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
    
    <span class="o">}</span>
    
    <span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method toString</span>
<span class="c">* @description Returns a string representing the menu.</span>
<span class="c">* @return {String}</span>
<span class="c">*/</span>
<span class="nx">toString</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">sReturnVal</span> <span class="o">=</span> <span class="nx">_MENU</span><span class="o">,</span>
        <span class="nx">sId</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">sId</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">sReturnVal</span> <span class="o">+=</span> <span class="o">(</span><span class="nx">_SPACE</span> <span class="o">+</span> <span class="nx">sId</span><span class="o">);</span>
    
    <span class="o">}</span>

    <span class="k">return</span> <span class="nx">sReturnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method setItemGroupTitle</span>
<span class="c">* @description Sets the title of a group of menu items.</span>
<span class="c">* @param {String} p_sGroupTitle String specifying the title of the group.</span>
<span class="c">* @param {Number} p_nGroupIndex Optional. Number specifying the group to which</span>
<span class="c">* the title belongs.</span>
<span class="c">*/</span>
<span class="nx">setItemGroupTitle</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_sGroupTitle</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nGroupIndex</span><span class="o">,</span>
        <span class="nx">oTitle</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">,</span>
        <span class="nx">nFirstIndex</span><span class="o">;</span>
        
    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">p_sGroupTitle</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">p_sGroupTitle</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">nGroupIndex</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">?</span> <span class="nx">p_nGroupIndex</span> <span class="o">:</span> <span class="m">0</span><span class="o">;</span>
        <span class="nx">oTitle</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">];</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">oTitle</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oTitle</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">p_sGroupTitle</span><span class="o">;</span>
            
        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>

            <span class="nx">oTitle</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">GROUP_TITLE_TAG_NAME</span><span class="o">);</span>
                    
            <span class="nx">oTitle</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">p_sGroupTitle</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">nGroupIndex</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oTitle</span><span class="o">;</span>

        <span class="o">}</span>


        <span class="nx">i</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>

        <span class="k">do</span> <span class="o">{</span>

            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">i</span><span class="o">])</span> <span class="o">{</span>

                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>

                <span class="nx">nFirstIndex</span> <span class="o">=</span> <span class="nx">i</span><span class="o">;</span>

            <span class="o">}</span>

        <span class="o">}</span>
        <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">nFirstIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span><span class="o">[</span><span class="nx">nFirstIndex</span><span class="o">],</span> 
                <span class="nx">_FIRST_OF_TYPE</span><span class="o">);</span>

        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">changeContentEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>

    <span class="o">}</span>

<span class="o">},</span>



<span class="c">/**</span>
<span class="c">* @method addItem</span>
<span class="c">* @description Appends an item to the menu.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem </span>
<span class="c">* instance to be added to the menu.</span>
<span class="c">* @param {String} p_oItem String specifying the text of the item to be added </span>
<span class="c">* to the menu.</span>
<span class="c">* @param {Object} p_oItem Object literal containing a set of menu item </span>
<span class="c">* configuration properties.</span>
<span class="c">* @param {Number} p_nGroupIndex Optional. Number indicating the group to</span>
<span class="c">* which the item belongs.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>
<span class="nx">addItem</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oItem</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_addItemToGroup</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method addItems</span>
<span class="c">* @description Adds an array of items to the menu.</span>
<span class="c">* @param {Array} p_aItems Array of items to be added to the menu.  The array </span>
<span class="c">* can contain strings specifying the text for each item to be created, object</span>
<span class="c">* literals specifying each of the menu item configuration properties, </span>
<span class="c">* or MenuItem instances.</span>
<span class="c">* @param {Number} p_nGroupIndex Optional. Number specifying the group to </span>
<span class="c">* which the items belongs.</span>
<span class="c">* @return {Array}</span>
<span class="c">*/</span>
<span class="nx">addItems</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_aItems</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">nItems</span><span class="o">,</span>
        <span class="nx">aItems</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">,</span>
        <span class="nx">returnVal</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">p_aItems</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">p_aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
        <span class="nx">aItems</span> <span class="o">=</span> <span class="o">[];</span>

        <span class="k">for</span><span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nItems</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>

            <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aItems</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">oItem</span><span class="o">))</span> <span class="o">{</span>
    
                    <span class="nx">aItems</span><span class="o">[</span><span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">addItems</span><span class="o">(</span><span class="nx">oItem</span><span class="o">,</span> <span class="nx">i</span><span class="o">);</span>
    
                <span class="o">}</span>
                <span class="k">else</span> <span class="o">{</span>
    
                    <span class="nx">aItems</span><span class="o">[</span><span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_addItemToGroup</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">oItem</span><span class="o">);</span>
                
                <span class="o">}</span>

            <span class="o">}</span>
    
        <span class="o">}</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
        
            <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">;</span>
        
        <span class="o">}</span>

    <span class="o">}</span>

	<span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method insertItem</span>
<span class="c">* @description Inserts an item into the menu at the specified index.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem </span>
<span class="c">* instance to be added to the menu.</span>
<span class="c">* @param {String} p_oItem String specifying the text of the item to be added </span>
<span class="c">* to the menu.</span>
<span class="c">* @param {Object} p_oItem Object literal containing a set of menu item </span>
<span class="c">* configuration properties.</span>
<span class="c">* @param {Number} p_nItemIndex Number indicating the ordinal position at which</span>
<span class="c">* the item should be added.</span>
<span class="c">* @param {Number} p_nGroupIndex Optional. Number indicating the group to which </span>
<span class="c">* the item belongs.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>
<span class="nx">insertItem</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oItem</span><span class="o">,</span> <span class="nx">p_nItemIndex</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>
    
	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_addItemToGroup</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_oItem</span><span class="o">,</span> <span class="nx">p_nItemIndex</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method removeItem</span>
<span class="c">* @description Removes the specified item from the menu.</span>
<span class="c">* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem </span>
<span class="c">* instance to be removed from the menu.</span>
<span class="c">* @param {Number} p_oObject Number specifying the index of the item </span>
<span class="c">* to be removed.</span>
<span class="c">* @param {Number} p_nGroupIndex Optional. Number specifying the group to </span>
<span class="c">* which the item belongs.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>
<span class="nx">removeItem</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_oObject</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span><span class="o">,</span>
    	<span class="nx">returnVal</span><span class="o">;</span>
    
    <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isUndefined</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">))</span> <span class="o">{</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">p_oObject</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">MenuItem</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_removeItemFromGroupByValue</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">);</span>           

        <span class="o">}</span>
        <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_oObject</span><span class="o">))</span> <span class="o">{</span>

            <span class="nx">oItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_removeItemFromGroupByIndex</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">);</span>

        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oItem</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span>

            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Item removed.&quot;</span> <span class="o">+</span> 
                <span class="s2">&quot; Text: &quot;</span> <span class="o">+</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;text&quot;</span><span class="o">)</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> 
                <span class="s2">&quot; Index: &quot;</span> <span class="o">+</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span> 
                <span class="s2">&quot; Group Index: &quot;</span> <span class="o">+</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

            <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">;</span>

        <span class="o">}</span>

    <span class="o">}</span>

	<span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method getItems</span>
<span class="c">* @description Returns an array of all of the items in the menu.</span>
<span class="c">* @return {Array}</span>
<span class="c">*/</span>
<span class="nx">getItems</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">aGroups</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">,</span>
        <span class="nx">nGroups</span><span class="o">,</span>
        <span class="nx">returnVal</span><span class="o">,</span>
        <span class="nx">aItems</span> <span class="o">=</span> <span class="o">[];</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">aGroups</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">nGroups</span> <span class="o">=</span> <span class="nx">aGroups</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>

        <span class="nx">returnVal</span> <span class="o">=</span> <span class="o">((</span><span class="nx">nGroups</span> <span class="o">==</span> <span class="m">1</span><span class="o">)</span> <span class="o">?</span> <span class="nx">aGroups</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">:</span> <span class="o">(</span><span class="nb">Array</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">concat</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">aItems</span><span class="o">,</span> <span class="nx">aGroups</span><span class="o">)));</span>

    <span class="o">}</span>

	<span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method getItemGroups</span>
<span class="c">* @description Multi-dimensional Array representing the menu items as they </span>
<span class="c">* are grouped in the menu.</span>
<span class="c">* @return {Array}</span>
<span class="c">*/</span>        
<span class="nx">getItemGroups</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method getItem</span>
<span class="c">* @description Returns the item at the specified index.</span>
<span class="c">* @param {Number} p_nItemIndex Number indicating the ordinal position of the </span>
<span class="c">* item to be retrieved.</span>
<span class="c">* @param {Number} p_nGroupIndex Optional. Number indicating the group to which </span>
<span class="c">* the item belongs.</span>
<span class="c">* @return {YAHOO.widget.MenuItem}</span>
<span class="c">*/</span>
<span class="nx">getItem</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_nItemIndex</span><span class="o">,</span> <span class="nx">p_nGroupIndex</span><span class="o">)</span> <span class="o">{</span>
    
    <span class="k">var</span> <span class="nx">aGroup</span><span class="o">,</span>
    	<span class="nx">returnVal</span><span class="o">;</span>
    
    <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">p_nItemIndex</span><span class="o">))</span> <span class="o">{</span>

        <span class="nx">aGroup</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getItemGroup</span><span class="o">(</span><span class="nx">p_nGroupIndex</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">aGroup</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">returnVal</span> <span class="o">=</span> <span class="nx">aGroup</span><span class="o">[</span><span class="nx">p_nItemIndex</span><span class="o">];</span>
        
        <span class="o">}</span>

    <span class="o">}</span>
    
    <span class="k">return</span> <span class="nx">returnVal</span><span class="o">;</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method getSubmenus</span>
<span class="c">* @description Returns an array of all of the submenus that are immediate </span>
<span class="c">* children of the menu.</span>
<span class="c">* @return {Array}</span>
<span class="c">*/</span>
<span class="nx">getSubmenus</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">aItems</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">(),</span>
        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">,</span>
        <span class="nx">aSubmenus</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">nItems</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
        
        <span class="nx">aSubmenus</span> <span class="o">=</span> <span class="o">[];</span>

        <span class="k">for</span><span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nItems</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>

            <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
            
            <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

                <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
                
                <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

                    <span class="nx">aSubmenus</span><span class="o">[</span><span class="nx">aSubmenus</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oSubmenu</span><span class="o">;</span>

                <span class="o">}</span>
            
            <span class="o">}</span>
        
        <span class="o">}</span>
    
    <span class="o">}</span>

    <span class="k">return</span> <span class="nx">aSubmenus</span><span class="o">;</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method clearContent</span>
<span class="c">* @description Removes all of the content from the menu, including the menu </span>
<span class="c">* items, group titles, header and footer.</span>
<span class="c">*/</span>
<span class="nx">clearContent</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">aItems</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">(),</span>
        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">,</span>
        <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span>
        <span class="nx">oBody</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">body</span><span class="o">,</span>
        <span class="nx">oHeader</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">header</span><span class="o">,</span>
        <span class="nx">oFooter</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">footer</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">nItems</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">i</span> <span class="o">=</span> <span class="nx">nItems</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>

        <span class="k">do</span> <span class="o">{</span>

            <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

                <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

                    <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">configChangedEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_onParentMenuConfigChange</span><span class="o">,</span> <span class="nx">oSubmenu</span><span class="o">);</span>

                    <span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_onParentMenuRender</span><span class="o">,</span> 
                        <span class="nx">oSubmenu</span><span class="o">);</span>

                <span class="o">}</span>
                
                <span class="k">this</span><span class="o">.</span><span class="nx">removeItem</span><span class="o">(</span><span class="nx">oItem</span><span class="o">,</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">groupIndex</span><span class="o">);</span>

            <span class="o">}</span>
        
        <span class="o">}</span>
        <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>

    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oHeader</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">);</span>
        <span class="nx">oElement</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oHeader</span><span class="o">);</span>

    <span class="o">}</span>
    

    <span class="k">if</span> <span class="o">(</span><span class="nx">oFooter</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">);</span>
        <span class="nx">oElement</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">oFooter</span><span class="o">);</span>
    <span class="o">}</span>


    <span class="k">if</span> <span class="o">(</span><span class="nx">oBody</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="nx">oBody</span><span class="o">);</span>

        <span class="nx">oBody</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">_EMPTY_STRING</span><span class="o">;</span>

    <span class="o">}</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span> <span class="o">=</span> <span class="o">[];</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span> <span class="o">=</span> <span class="o">[];</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span> <span class="o">=</span> <span class="o">[];</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_WIDTH</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method destroy</span>
<span class="c">* @description Removes the menu&#39;s &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element </span>
<span class="c">* (and accompanying child nodes) from the document.</span>
<span class="c">*/</span>
<span class="nx">destroy</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="c">// Remove all items</span>
<span class="c"></span>
    <span class="k">this</span><span class="o">.</span><span class="nx">clearContent</span><span class="o">();</span>

    <span class="k">this</span><span class="o">.</span><span class="nx">_aItemGroups</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_aListElements</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_aGroupTitleElements</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>


    <span class="c">// Continue with the superclass implementation of this method</span>
<span class="c"></span>
    <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">destroy</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
    
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Destroyed.&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method setInitialFocus</span>
<span class="c">* @description Sets focus to the menu&#39;s first enabled item.</span>
<span class="c">*/</span>
<span class="nx">setInitialFocus</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getFirstEnabledItem</span><span class="o">();</span>
    
    <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oItem</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>

    <span class="o">}</span>
    
<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method setInitialSelection</span>
<span class="c">* @description Sets the &quot;selected&quot; configuration property of the menu&#39;s first </span>
<span class="c">* enabled item to &quot;true.&quot;</span>
<span class="c">*/</span>
<span class="nx">setInitialSelection</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getFirstEnabledItem</span><span class="o">();</span>
    
    <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>
    
        <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    <span class="o">}</span>        

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method clearActiveItem</span>
<span class="c">* @description Sets the &quot;selected&quot; configuration property of the menu&#39;s active</span>
<span class="c">* item to &quot;false&quot; and hides the item&#39;s submenu.</span>
<span class="c">* @param {Boolean} p_bBlur Boolean indicating if the menu&#39;s active item </span>
<span class="c">* should be blurred.  </span>
<span class="c">*/</span>
<span class="nx">clearActiveItem</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">p_bBlur</span><span class="o">)</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SHOW_DELAY</span><span class="o">)</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
    
        <span class="k">this</span><span class="o">.</span><span class="nx">_cancelShowDelay</span><span class="o">();</span>
    
    <span class="o">}</span>


    <span class="k">var</span> <span class="nx">oActiveItem</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span><span class="o">,</span>
        <span class="nx">oConfig</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="nx">oActiveItem</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">oConfig</span> <span class="o">=</span> <span class="nx">oActiveItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">p_bBlur</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oActiveItem</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">().</span><span class="nx">_hasFocus</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
        
        <span class="o">}</span>

        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">_SELECTED</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>

        <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>


        <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span>

        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">activeItem</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>  

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method focus</span>
<span class="c">* @description Causes the menu to receive focus and fires the &quot;focus&quot; event.</span>
<span class="c">*/</span>
<span class="nx">focus</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">hasFocus</span><span class="o">())</span> <span class="o">{</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">setInitialFocus</span><span class="o">();</span>
    
    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method blur</span>
<span class="c">* @description Causes the menu to lose focus and fires the &quot;blur&quot; event.</span>
<span class="c">*/</span>    
<span class="nx">blur</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">var</span> <span class="nx">oItem</span><span class="o">;</span>

    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">hasFocus</span><span class="o">())</span> <span class="o">{</span>
    
        <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">MenuManager</span><span class="o">.</span><span class="nx">getFocusedMenuItem</span><span class="o">();</span>
        
        <span class="k">if</span> <span class="o">(</span><span class="nx">oItem</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oItem</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>

        <span class="o">}</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @method hasFocus</span>
<span class="c">* @description Returns a boolean indicating whether or not the menu has focus.</span>
<span class="c">* @return {Boolean}</span>
<span class="c">*/</span>
<span class="nx">hasFocus</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">return</span> <span class="o">(</span><span class="nx">MenuManager</span><span class="o">.</span><span class="nx">getFocusedMenu</span><span class="o">()</span> <span class="o">==</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">());</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* Adds the specified CustomEvent subscriber to the menu and each of </span>
<span class="c">* its submenus.</span>
<span class="c">* @method subscribe</span>
<span class="c">* @param p_type     {string}   the type, or name of the event</span>
<span class="c">* @param p_fn       {function} the function to exectute when the event fires</span>
<span class="c">* @param p_obj      {Object}   An object to be passed along when the event </span>
<span class="c">*                              fires</span>
<span class="c">* @param p_override {boolean}  If true, the obj passed in becomes the </span>
<span class="c">*                              execution scope of the listener</span>
<span class="c">*/</span>
<span class="nx">subscribe</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="k">function</span> <span class="nx">onItemAdded</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>
            <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">);</span>

        <span class="o">}</span>
    
    <span class="o">}</span>


    <span class="k">function</span> <span class="nx">onSubmenuAdded</span><span class="o">(</span><span class="nx">p_sType</span><span class="o">,</span> <span class="nx">p_aArgs</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">)</span> <span class="o">{</span> 
    
        <span class="k">var</span> <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
        
        <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>

            <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">,</span> <span class="nx">p_oObject</span><span class="o">);</span>
        
        <span class="o">}</span>
    
    <span class="o">}</span>


    <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
    <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">_ITEM_ADDED</span><span class="o">,</span> <span class="nx">onItemAdded</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>


    <span class="k">var</span> <span class="nx">aItems</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">(),</span>
        <span class="nx">nItems</span><span class="o">,</span>
        <span class="nx">oItem</span><span class="o">,</span>
        <span class="nx">oSubmenu</span><span class="o">,</span>
        <span class="nx">i</span><span class="o">;</span>
        

    <span class="k">if</span> <span class="o">(</span><span class="nx">aItems</span><span class="o">)</span> <span class="o">{</span>

        <span class="nx">nItems</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
        
        <span class="k">if</span> <span class="o">(</span><span class="nx">nItems</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
        
            <span class="nx">i</span> <span class="o">=</span> <span class="nx">nItems</span> <span class="o">-</span> <span class="m">1</span><span class="o">;</span>
            
            <span class="k">do</span> <span class="o">{</span>

                <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">aItems</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                
                <span class="nx">oSubmenu</span> <span class="o">=</span> <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">);</span>
                
                <span class="k">if</span> <span class="o">(</span><span class="nx">oSubmenu</span><span class="o">)</span> <span class="o">{</span>
                
                    <span class="nx">oSubmenu</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="nx">oSubmenu</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
                
                <span class="o">}</span>
                <span class="k">else</span> <span class="o">{</span>
                
                    <span class="nx">oItem</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">_SUBMENU</span><span class="o">,</span> <span class="nx">onSubmenuAdded</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
                
                <span class="o">}</span>

            <span class="o">}</span>
            <span class="k">while</span> <span class="o">(</span><span class="nx">i</span><span class="o">--);</span>
        
        <span class="o">}</span>

    <span class="o">}</span>

<span class="o">},</span>


<span class="c">/**</span>
<span class="c">* @description Initializes the class&#39;s configurable properties which can be</span>
<span class="c">* changed using the menu&#39;s Config object (&quot;cfg&quot;).</span>
<span class="c">* @method initDefaultConfig</span>
<span class="c">*/</span>
<span class="nx">initDefaultConfig</span><span class="o">:</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>

    <span class="nx">Menu</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">initDefaultConfig</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>

    <span class="k">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">;</span>


    <span class="c">// Module documentation overrides</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">    * @config effect</span>
<span class="c">    * @description Object or array of objects representing the ContainerEffect </span>
<span class="c">    * classes that are active for animating the container.  When set this </span>
<span class="c">    * property is automatically applied to all submenus.</span>
<span class="c">    * @type Object</span>
<span class="c">    * @default null</span>
<span class="c">    */</span>

    <span class="c">// Overlay documentation overrides</span>
<span class="c"></span>

    <span class="c">/**</span>
<span class="c">    * @config x</span>
<span class="c">    * @description Number representing the absolute x-coordinate position of </span>
<span class="c">    * the Menu.  This property is only applied when the &quot;position&quot; </span>
<span class="c">    * configuration property is set to dynamic.</span>
<span class="c">    * @type Number</span>
<span class="c">    * @default null</span>
<span class="c">    */</span>
    

    <span class="c">/**</span>
<span class="c">    * @config y</span>
<span class="c">    * @description Number representing the absolute y-coordinate position of </span>
<span class="c">    * the Menu.  This property is only applied when the &quot;position&quot; </span>
<span class="c">    * configuration property is set to dynamic.</span>
<span class="c">    * @type Number</span>
<span class="c">    * @default null</span>
<span class="c">    */</span>


    <span class="c">/**</span>
<span class="c">    * @description Array of the absolute x and y positions of the Menu.  This </span>
<span class="c">    * property is only applied when the &quot;position&quot; configuration property is </span>
<span class="c">    * set to dynamic.</span>
<span class="c">    * @config xy</span>
<span class="c">    * @type Number[]</span>
<span class="c">    * @default null</span>
<span class="c">    */</span>
    

    <span class="c">/**</span>
<span class="c">    * @config context</span>
<span class="c">    * @description Array of context arguments for context-sensitive positioning.  </span>
<span class="c">    * The format is: [id or element, element corner, context corner]. </span>
<span class="c">    * For example, setting this property to [&quot;img1&quot;, &quot;tl&quot;, &quot;bl&quot;] would </span>
<span class="c">    * align the Mnu&#39;s top left corner to the context element&#39;s </span>
<span class="c">    * bottom left corner.  This property is only applied when the &quot;position&quot; </span>
<span class="c">    * configuration property is set to dynamic.</span>
<span class="c">    * @type Array</span>
<span class="c">    * @default null</span>
<span class="c">    */</span>
    
    
    <span class="c">/**</span>
<span class="c">    * @config fixedcenter</span>
<span class="c">    * @description Boolean indicating if the Menu should be anchored to the </span>
<span class="c">    * center of the viewport.  This property is only applied when the </span>
<span class="c">    * &quot;position&quot; configuration property is set to dynamic.</span>
<span class="c">    * @type Boolean</span>
<span class="c">    * @default false</span>
<span class="c">    */</span>
    
    
    <span class="c">/**</span>
<span class="c">    * @config iframe</span>
<span class="c">    * @description Boolean indicating whether or not the Menu should </span>
<span class="c">    * have an IFRAME shim; used to prevent SELECT elements from </span>
<span class="c">    * poking through an Overlay instance in IE6.  When set to &quot;true&quot;, </span>
<span class="c">    * the iframe shim is created when the Menu instance is intially</span>
<span class="c">    * made visible.  This property is only applied when the &quot;position&quot; </span>
<span class="c">    * configuration property is set to dynamic and is automatically applied </span>
<span class="c">    * to all submenus.</span>
<span class="c">    * @type Boolean</span>
<span class="c">    * @default true for IE6 and below, false for all other browsers.</span>
<span class="c">    */</span>


	<span class="c">// Add configuration attributes</span>
<span class="c"></span>
    <span class="c">/*</span>
<span class="c">        Change the default value for the &quot;visible&quot; configuration </span>
<span class="c">        property to &quot;false&quot; by re-adding the property.</span>
<span class="c">    */</span>

    <span class="c">/**</span>
<span class="c">    * @config visible</span>
<span class="c">    * @description Boolean indicating whether or not the menu is visible.  If </span>
<span class="c">    * the menu&#39;s &quot;position&quot; configuration property is set to &quot;dynamic&quot; (the </span>
<span class="c">    * default), this property toggles the menu&#39;s &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; </span>
<span class="c">    * element&#39;s &quot;visibility&quot; style property between &quot;visible&quot; (true) or </span>
<span class="c">    * &quot;hidden&quot; (false).  If the menu&#39;s &quot;position&quot; configuration property is </span>
<span class="c">    * set to &quot;static&quot; this property toggles the menu&#39;s </span>
<span class="c">    * &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element&#39;s &quot;display&quot; style property </span>
<span class="c">    * between &quot;block&quot; (true) or &quot;none&quot; (false).</span>
<span class="c">    * @default false</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">VISIBLE_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span>
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configVisible</span><span class="o">,</span> 
            <span class="nx">value</span><span class="o">:</span> <span class="nx">VISIBLE_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">VISIBLE_CONFIG</span><span class="o">.</span><span class="nx">validator</span>
        <span class="o">}</span>
     <span class="o">);</span>


    <span class="c">/*</span>
<span class="c">        Change the default value for the &quot;constraintoviewport&quot; configuration </span>
<span class="c">        property (inherited by YAHOO.widget.Overlay) to &quot;true&quot; by re-adding the property.</span>
<span class="c">    */</span>

    <span class="c">/**</span>
<span class="c">    * @config constraintoviewport</span>
<span class="c">    * @description Boolean indicating if the menu will try to remain inside </span>
<span class="c">    * the boundaries of the size of viewport.  This property is only applied </span>
<span class="c">    * when the &quot;position&quot; configuration property is set to dynamic and is </span>
<span class="c">    * automatically applied to all submenus.</span>
<span class="c">    * @default true</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">CONSTRAIN_TO_VIEWPORT_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span>
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configConstrainToViewport</span><span class="o">,</span> 
            <span class="nx">value</span><span class="o">:</span> <span class="nx">CONSTRAIN_TO_VIEWPORT_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">CONSTRAIN_TO_VIEWPORT_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span> 
            <span class="nx">supercedes</span><span class="o">:</span> <span class="nx">CONSTRAIN_TO_VIEWPORT_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span> 
        <span class="o">}</span> 
    <span class="o">);</span>


    <span class="c">/*</span>
<span class="c">        Change the default value for the &quot;preventcontextoverlap&quot; configuration </span>
<span class="c">        property (inherited by YAHOO.widget.Overlay) to &quot;true&quot; by re-adding the property.</span>
<span class="c">    */</span>

	<span class="c">/**</span>
<span class="c">	* @config preventcontextoverlap</span>
<span class="c">	* @description Boolean indicating whether or not a submenu should overlap its parent MenuItem </span>
<span class="c">	* when the &quot;constraintoviewport&quot; configuration property is set to &quot;true&quot;.</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default true</span>
<span class="c">	*/</span>
	<span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">PREVENT_CONTEXT_OVERLAP_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span>

		<span class="nx">value</span><span class="o">:</span> <span class="nx">PREVENT_CONTEXT_OVERLAP_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
		<span class="nx">validator</span><span class="o">:</span> <span class="nx">PREVENT_CONTEXT_OVERLAP_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span> 
		<span class="nx">supercedes</span><span class="o">:</span> <span class="nx">PREVENT_CONTEXT_OVERLAP_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span>

	<span class="o">});</span>


    <span class="c">/**</span>
<span class="c">    * @config position</span>
<span class="c">    * @description String indicating how a menu should be positioned on the </span>
<span class="c">    * screen.  Possible values are &quot;static&quot; and &quot;dynamic.&quot;  Static menus are </span>
<span class="c">    * visible by default and reside in the normal flow of the document </span>
<span class="c">    * (CSS position: static).  Dynamic menus are hidden by default, reside </span>
<span class="c">    * out of the normal flow of the document (CSS position: absolute), and </span>
<span class="c">    * can overlay other elements on the screen.</span>
<span class="c">    * @default dynamic</span>
<span class="c">    * @type String</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">POSITION_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span>
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configPosition</span><span class="o">,</span>
            <span class="nx">value</span><span class="o">:</span> <span class="nx">POSITION_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">POSITION_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">supercedes</span><span class="o">:</span> <span class="nx">POSITION_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span>
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config submenualignment</span>
<span class="c">    * @description Array defining how submenus should be aligned to their </span>
<span class="c">    * parent menu item. The format is: [itemCorner, submenuCorner]. By default</span>
<span class="c">    * a submenu&#39;s top left corner is aligned to its parent menu item&#39;s top </span>
<span class="c">    * right corner.</span>
<span class="c">    * @default [&quot;tl&quot;,&quot;tr&quot;]</span>
<span class="c">    * @type Array</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">SUBMENU_ALIGNMENT_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">value</span><span class="o">:</span> <span class="nx">SUBMENU_ALIGNMENT_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span>
            <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">SUBMENU_ALIGNMENT_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config autosubmenudisplay</span>
<span class="c">    * @description Boolean indicating if submenus are automatically made </span>
<span class="c">    * visible when the user mouses over the menu&#39;s items.</span>
<span class="c">    * @default true</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
	<span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
	   <span class="nx">AUTO_SUBMENU_DISPLAY_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
	   <span class="o">{</span> 
	       <span class="nx">value</span><span class="o">:</span> <span class="nx">AUTO_SUBMENU_DISPLAY_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
	       <span class="nx">validator</span><span class="o">:</span> <span class="nx">AUTO_SUBMENU_DISPLAY_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
	       <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">AUTO_SUBMENU_DISPLAY_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
       <span class="o">}</span> 
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config showdelay</span>
<span class="c">    * @description Number indicating the time (in milliseconds) that should </span>
<span class="c">    * expire before a submenu is made visible when the user mouses over </span>
<span class="c">    * the menu&#39;s items.  This property is only applied when the &quot;position&quot; </span>
<span class="c">    * configuration property is set to dynamic and is automatically applied </span>
<span class="c">    * to all submenus.</span>
<span class="c">    * @default 250</span>
<span class="c">    * @type Number</span>
<span class="c">    */</span>
	<span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
	   <span class="nx">SHOW_DELAY_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
	   <span class="o">{</span> 
	       <span class="nx">value</span><span class="o">:</span> <span class="nx">SHOW_DELAY_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
	       <span class="nx">validator</span><span class="o">:</span> <span class="nx">SHOW_DELAY_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
	       <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">SHOW_DELAY_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
       <span class="o">}</span> 
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config hidedelay</span>
<span class="c">    * @description Number indicating the time (in milliseconds) that should </span>
<span class="c">    * expire before the menu is hidden.  This property is only applied when </span>
<span class="c">    * the &quot;position&quot; configuration property is set to dynamic and is </span>
<span class="c">    * automatically applied to all submenus.</span>
<span class="c">    * @default 0</span>
<span class="c">    * @type Number</span>
<span class="c">    */</span>
	<span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
	   <span class="nx">HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
	   <span class="o">{</span> 
	       <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configHideDelay</span><span class="o">,</span>
	       <span class="nx">value</span><span class="o">:</span> <span class="nx">HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
	       <span class="nx">validator</span><span class="o">:</span> <span class="nx">HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span> 
	       <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
       <span class="o">}</span> 
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config submenuhidedelay</span>
<span class="c">    * @description Number indicating the time (in milliseconds) that should </span>
<span class="c">    * expire before a submenu is hidden when the user mouses out of a menu item </span>
<span class="c">    * heading in the direction of a submenu.  The value must be greater than or </span>
<span class="c">    * equal to the value specified for the &quot;showdelay&quot; configuration property.</span>
<span class="c">    * This property is only applied when the &quot;position&quot; configuration property </span>
<span class="c">    * is set to dynamic and is automatically applied to all submenus.</span>
<span class="c">    * @default 250</span>
<span class="c">    * @type Number</span>
<span class="c">    */</span>
	<span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
	   <span class="nx">SUBMENU_HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
	   <span class="o">{</span> 
	       <span class="nx">value</span><span class="o">:</span> <span class="nx">SUBMENU_HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
	       <span class="nx">validator</span><span class="o">:</span> <span class="nx">SUBMENU_HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
	       <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">SUBMENU_HIDE_DELAY_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
       <span class="o">}</span> 
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config clicktohide</span>
<span class="c">    * @description Boolean indicating if the menu will automatically be </span>
<span class="c">    * hidden if the user clicks outside of it.  This property is only </span>
<span class="c">    * applied when the &quot;position&quot; configuration property is set to dynamic </span>
<span class="c">    * and is automatically applied to all submenus.</span>
<span class="c">    * @default true</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">CLICK_TO_HIDE_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>
        <span class="o">{</span>
            <span class="nx">value</span><span class="o">:</span> <span class="nx">CLICK_TO_HIDE_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span>
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">CLICK_TO_HIDE_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">CLICK_TO_HIDE_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
        <span class="o">}</span>
    <span class="o">);</span>


	<span class="c">/**</span>
<span class="c">	* @config container</span>
<span class="c">	* @description HTML element reference or string specifying the id </span>
<span class="c">	* attribute of the HTML element that the menu&#39;s markup should be </span>
<span class="c">	* rendered into.</span>
<span class="c">	* @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="c">	* level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;|String</span>
<span class="c">	* @default document.body</span>
<span class="c">	*/</span>
	<span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
	   <span class="nx">CONTAINER_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
	   <span class="o">{</span> 
	       <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configContainer</span><span class="o">,</span>
	       <span class="nx">value</span><span class="o">:</span> <span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">,</span>
           <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">CONTAINER_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
       <span class="o">}</span> 
   <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config scrollincrement</span>
<span class="c">    * @description Number used to control the scroll speed of a menu.  Used to </span>
<span class="c">    * increment the &quot;scrollTop&quot; property of the menu&#39;s body by when a menu&#39;s </span>
<span class="c">    * content is scrolling.  When set this property is automatically applied </span>
<span class="c">    * to all submenus.</span>
<span class="c">    * @default 1</span>
<span class="c">    * @type Number</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">SCROLL_INCREMENT_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">value</span><span class="o">:</span> <span class="nx">SCROLL_INCREMENT_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">SCROLL_INCREMENT_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">supercedes</span><span class="o">:</span> <span class="nx">SCROLL_INCREMENT_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span><span class="o">,</span>
            <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">SCROLL_INCREMENT_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config minscrollheight</span>
<span class="c">    * @description Number defining the minimum threshold for the &quot;maxheight&quot; </span>
<span class="c">    * configuration property.  When set this property is automatically applied </span>
<span class="c">    * to all submenus.</span>
<span class="c">    * @default 90</span>
<span class="c">    * @type Number</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">MIN_SCROLL_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">value</span><span class="o">:</span> <span class="nx">MIN_SCROLL_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">MIN_SCROLL_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">supercedes</span><span class="o">:</span> <span class="nx">MIN_SCROLL_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span><span class="o">,</span>
            <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">MIN_SCROLL_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config maxheight</span>
<span class="c">    * @description Number defining the maximum height (in pixels) for a menu&#39;s </span>
<span class="c">    * body element (&lt;code&gt;&amp;#60;div class=&quot;bd&quot;&amp;#60;&lt;/code&gt;).  Once a menu&#39;s body </span>
<span class="c">    * exceeds this height, the contents of the body are scrolled to maintain </span>
<span class="c">    * this value.  This value cannot be set lower than the value of the </span>
<span class="c">    * &quot;minscrollheight&quot; configuration property.</span>
<span class="c">    * @default 0</span>
<span class="c">    * @type Number</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
       <span class="nx">MAX_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
       <span class="o">{</span>
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configMaxHeight</span><span class="o">,</span>
            <span class="nx">value</span><span class="o">:</span> <span class="nx">MAX_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span>
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">MAX_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">MAX_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span><span class="o">,</span>
            <span class="nx">supercedes</span><span class="o">:</span> <span class="nx">MAX_HEIGHT_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span>            
       <span class="o">}</span> 
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config classname</span>
<span class="c">    * @description String representing the CSS class to be applied to the </span>
<span class="c">    * menu&#39;s root &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element.  The specified class(es)  </span>
<span class="c">    * are appended in addition to the default class as specified by the menu&#39;s</span>
<span class="c">    * CSS_CLASS_NAME constant. When set this property is automatically </span>
<span class="c">    * applied to all submenus.</span>
<span class="c">    * @default null</span>
<span class="c">    * @type String</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">CLASS_NAME_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configClassName</span><span class="o">,</span>
            <span class="nx">value</span><span class="o">:</span> <span class="nx">CLASS_NAME_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">CLASS_NAME_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">supercedes</span><span class="o">:</span> <span class="nx">CLASS_NAME_CONFIG</span><span class="o">.</span><span class="nx">supercedes</span>      
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config disabled</span>
<span class="c">    * @description Boolean indicating if the menu should be disabled.  </span>
<span class="c">    * Disabling a menu disables each of its items.  (Disabled menu items are </span>
<span class="c">    * dimmed and will not respond to user input or fire events.)  Disabled</span>
<span class="c">    * menus have a corresponding &quot;disabled&quot; CSS class applied to their root</span>
<span class="c">    * &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element.</span>
<span class="c">    * @default false</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">DISABLED_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configDisabled</span><span class="o">,</span>
            <span class="nx">value</span><span class="o">:</span> <span class="nx">DISABLED_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">DISABLED_CONFIG</span><span class="o">.</span><span class="nx">validator</span><span class="o">,</span>
            <span class="nx">suppressEvent</span><span class="o">:</span> <span class="nx">DISABLED_CONFIG</span><span class="o">.</span><span class="nx">suppressEvent</span>
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config shadow</span>
<span class="c">    * @description Boolean indicating if the menu should have a shadow.</span>
<span class="c">    * @default true</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">SHADOW_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">handler</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">configShadow</span><span class="o">,</span>
            <span class="nx">value</span><span class="o">:</span> <span class="nx">SHADOW_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">SHADOW_CONFIG</span><span class="o">.</span><span class="nx">validator</span>
        <span class="o">}</span>
    <span class="o">);</span>


    <span class="c">/**</span>
<span class="c">    * @config keepopen</span>
<span class="c">    * @description Boolean indicating if the menu should remain open when clicked.</span>
<span class="c">    * @default false</span>
<span class="c">    * @type Boolean</span>
<span class="c">    */</span>
    <span class="nx">oConfig</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span>
        <span class="nx">KEEP_OPEN_CONFIG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> 
        <span class="o">{</span> 
            <span class="nx">value</span><span class="o">:</span> <span class="nx">KEEP_OPEN_CONFIG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> 
            <span class="nx">validator</span><span class="o">:</span> <span class="nx">KEEP_OPEN_CONFIG</span><span class="o">.</span><span class="nx">validator</span>
        <span class="o">}</span>
    <span class="o">);</span>

<span class="o">}</span>

<span class="o">});</span> <span class="c">// END YAHOO.lang.extend</span>
<span class="c"></span>
<span class="o">})();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class="selected"><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.ContextMenu.html" title="YAHOO.widget.ContextMenu">YAHOO.widget.ContextMenu</a></li>
                                <li class=""><a href="YAHOO.widget.ContextMenuItem.html" title="YAHOO.widget.ContextMenuItem">YAHOO.widget.ContextMenuItem</a></li>
                                <li class=""><a href="YAHOO.widget.Menu.html" title="YAHOO.widget.Menu">YAHOO.widget.Menu</a></li>
                                <li class=""><a href="YAHOO.widget.MenuBar.html" title="YAHOO.widget.MenuBar">YAHOO.widget.MenuBar</a></li>
                                <li class=""><a href="YAHOO.widget.MenuBarItem.html" title="YAHOO.widget.MenuBarItem">YAHOO.widget.MenuBarItem</a></li>
                                <li class=""><a href="YAHOO.widget.MenuItem.html" title="YAHOO.widget.MenuItem">YAHOO.widget.MenuItem</a></li>
                                <li class=""><a href="YAHOO.widget.MenuManager.html" title="YAHOO.widget.MenuManager">YAHOO.widget.MenuManager</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="contextmenu.js.html" title="contextmenu.js">contextmenu.js</a></li>
                                <li class=""><a href="contextmenuitem.js.html" title="contextmenuitem.js">contextmenuitem.js</a></li>
                                <li class="selected"><a href="menu.js.html" title="menu.js">menu.js</a></li>
                                <li class=""><a href="menuariaplugin.js.html" title="menuariaplugin.js">menuariaplugin.js</a></li>
                                <li class=""><a href="menubar.js.html" title="menubar.js">menubar.js</a></li>
                                <li class=""><a href="menubaritem.js.html" title="menubaritem.js">menubaritem.js</a></li>
                                <li class=""><a href="menuitem.js.html" title="menuitem.js">menuitem.js</a></li>
                                <li class=""><a href="menumanager.js.html" title="menumanager.js">menumanager.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2009 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.widget.Menu", "name": "activeItem", "url": "YAHOO.widget.Menu.html#property_activeItem", "type": "property"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "addClassNameForState", "url": "YAHOO.widget.MenuItem.html#method_addClassNameForState", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "addItem", "url": "YAHOO.widget.Menu.html#method_addItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "addItems", "url": "YAHOO.widget.Menu.html#method_addItems", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_addItemToGroup", "url": "YAHOO.widget.Menu.html#method__addItemToGroup", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "addMenu", "url": "YAHOO.widget.MenuManager.html#method_addMenu", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_aGroupTitleElements", "url": "YAHOO.widget.Menu.html#property__aGroupTitleElements", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_aItemGroups", "url": "YAHOO.widget.Menu.html#property__aItemGroups", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_aListElements", "url": "YAHOO.widget.Menu.html#property__aListElements", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "autosubmenudisplay", "url": "YAHOO.widget.Menu.html#config_autosubmenudisplay", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "autosubmenudisplay", "url": "YAHOO.widget.MenuBar.html#config_autosubmenudisplay", "type": "config"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "_bCancelled", "url": "YAHOO.widget.ContextMenu.html#property__bCancelled", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_bHandledMouseOutEvent", "url": "YAHOO.widget.Menu.html#property__bHandledMouseOutEvent", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_bHandledMouseOverEvent", "url": "YAHOO.widget.Menu.html#property__bHandledMouseOverEvent", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "blur", "url": "YAHOO.widget.Menu.html#method_blur", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "blur", "url": "YAHOO.widget.MenuItem.html#method_blur", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "blurEvent", "url": "YAHOO.widget.MenuItem.html#event_blurEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "browser", "url": "YAHOO.widget.MenuItem.html#property_browser", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_bStopMouseEventHandlers", "url": "YAHOO.widget.Menu.html#property__bStopMouseEventHandlers", "type": "property"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "cancel", "url": "YAHOO.widget.ContextMenu.html#method_cancel", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_cancelHideDelay", "url": "YAHOO.widget.Menu.html#method__cancelHideDelay", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_cancelShowDelay", "url": "YAHOO.widget.Menu.html#method__cancelShowDelay", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "checked", "url": "YAHOO.widget.MenuItem.html#config_checked", "type": "config"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "checkPosition", "url": "YAHOO.widget.Menu.html#method_checkPosition", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuBar", "name": "checkPosition", "url": "YAHOO.widget.MenuBar.html#method_checkPosition", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "classname", "url": "YAHOO.widget.Menu.html#config_classname", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "classname", "url": "YAHOO.widget.MenuItem.html#config_classname", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "clearActiveItem", "url": "YAHOO.widget.Menu.html#method_clearActiveItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "clearContent", "url": "YAHOO.widget.Menu.html#method_clearContent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_clearSetWidthFlag", "url": "YAHOO.widget.Menu.html#method__clearSetWidthFlag", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "clickEvent", "url": "YAHOO.widget.Menu.html#event_clickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "clickEvent", "url": "YAHOO.widget.MenuItem.html#event_clickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "clicktohide", "url": "YAHOO.widget.Menu.html#config_clicktohide", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configChecked", "url": "YAHOO.widget.MenuItem.html#method_configChecked", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configClassName", "url": "YAHOO.widget.Menu.html#method_configClassName", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configClassName", "url": "YAHOO.widget.MenuItem.html#method_configClassName", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configContainer", "url": "YAHOO.widget.Menu.html#method_configContainer", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configDisabled", "url": "YAHOO.widget.Menu.html#method_configDisabled", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configDisabled", "url": "YAHOO.widget.MenuItem.html#method_configDisabled", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configEmphasis", "url": "YAHOO.widget.MenuItem.html#method_configEmphasis", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configHelpText", "url": "YAHOO.widget.MenuItem.html#method_configHelpText", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configHideDelay", "url": "YAHOO.widget.Menu.html#method_configHideDelay", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configIframe", "url": "YAHOO.widget.Menu.html#method_configIframe", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configKeyListener", "url": "YAHOO.widget.MenuItem.html#method_configKeyListener", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configMaxHeight", "url": "YAHOO.widget.Menu.html#method_configMaxHeight", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configOnClick", "url": "YAHOO.widget.MenuItem.html#method_configOnClick", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configPosition", "url": "YAHOO.widget.Menu.html#method_configPosition", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configSelected", "url": "YAHOO.widget.MenuItem.html#method_configSelected", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configShadow", "url": "YAHOO.widget.Menu.html#method_configShadow", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configStrongEmphasis", "url": "YAHOO.widget.MenuItem.html#method_configStrongEmphasis", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configSubmenu", "url": "YAHOO.widget.MenuItem.html#method_configSubmenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "configSubmenuToggle", "url": "YAHOO.widget.MenuBar.html#method_configSubmenuToggle", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configTarget", "url": "YAHOO.widget.MenuItem.html#method_configTarget", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configText", "url": "YAHOO.widget.MenuItem.html#method_configText", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "configTrigger", "url": "YAHOO.widget.ContextMenu.html#method_configTrigger", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_configureSubmenu", "url": "YAHOO.widget.Menu.html#method__configureSubmenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "configURL", "url": "YAHOO.widget.MenuItem.html#method_configURL", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "configVisible", "url": "YAHOO.widget.Menu.html#method_configVisible", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "constraintoviewport", "url": "YAHOO.widget.Menu.html#config_constraintoviewport", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "constructor", "url": "YAHOO.widget.MenuItem.html#property_constructor", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "container", "url": "YAHOO.widget.Menu.html#config_container", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "context", "url": "YAHOO.widget.Menu.html#config_context", "type": "config"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "contextEventTarget", "url": "YAHOO.widget.ContextMenu.html#property_contextEventTarget", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_createItemGroup", "url": "YAHOO.widget.Menu.html#method__createItemGroup", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_createKeyListener", "url": "YAHOO.widget.MenuItem.html#method__createKeyListener", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_createRootNodeStructure", "url": "YAHOO.widget.MenuItem.html#method__createRootNodeStructure", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "CSS_CLASS_NAME", "url": "YAHOO.widget.Menu.html#property_CSS_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuBarItem", "name": "CSS_CLASS_NAME", "url": "YAHOO.widget.MenuBarItem.html#property_CSS_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "CSS_CLASS_NAME", "url": "YAHOO.widget.MenuBar.html#property_CSS_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "CSS_CLASS_NAME", "url": "YAHOO.widget.MenuItem.html#property_CSS_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuBarItem", "name": "CSS_LABEL_CLASS_NAME", "url": "YAHOO.widget.MenuBarItem.html#property_CSS_LABEL_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "CSS_LABEL_CLASS_NAME", "url": "YAHOO.widget.MenuItem.html#property_CSS_LABEL_CLASS_NAME", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "DEFAULT_CONFIG", "url": "YAHOO.widget.ContextMenu.html#property_DEFAULT_CONFIG", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "destroy", "url": "YAHOO.widget.Menu.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "destroy", "url": "YAHOO.widget.ContextMenu.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "destroy", "url": "YAHOO.widget.MenuItem.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "destroyEvent", "url": "YAHOO.widget.MenuItem.html#event_destroyEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "disabled", "url": "YAHOO.widget.Menu.html#config_disabled", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "disabled", "url": "YAHOO.widget.MenuItem.html#config_disabled", "type": "config"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_disableScrollFooter", "url": "YAHOO.widget.Menu.html#method__disableScrollFooter", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_disableScrollHeader", "url": "YAHOO.widget.Menu.html#method__disableScrollHeader", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_dispatchClickEvent", "url": "YAHOO.widget.MenuItem.html#method__dispatchClickEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "effect", "url": "YAHOO.widget.Menu.html#config_effect", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "element", "url": "YAHOO.widget.MenuItem.html#property_element", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "emphasis", "url": "YAHOO.widget.MenuItem.html#config_emphasis", "type": "config"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_enableScrollFooter", "url": "YAHOO.widget.Menu.html#method__enableScrollFooter", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_enableScrollHeader", "url": "YAHOO.widget.Menu.html#method__enableScrollHeader", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "EVENT_TYPES", "url": "YAHOO.widget.ContextMenu.html#property_EVENT_TYPES", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_execHideDelay", "url": "YAHOO.widget.Menu.html#method__execHideDelay", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_execSubmenuHideDelay", "url": "YAHOO.widget.Menu.html#method__execSubmenuHideDelay", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "fixedcenter", "url": "YAHOO.widget.Menu.html#config_fixedcenter", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "focus", "url": "YAHOO.widget.Menu.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "focus", "url": "YAHOO.widget.MenuItem.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "focusEvent", "url": "YAHOO.widget.MenuItem.html#event_focusEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "getClassNameForState", "url": "YAHOO.widget.MenuItem.html#method_getClassNameForState", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_getFirstEnabledItem", "url": "YAHOO.widget.Menu.html#method__getFirstEnabledItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getFocusedMenu", "url": "YAHOO.widget.MenuManager.html#method_getFocusedMenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getFocusedMenuItem", "url": "YAHOO.widget.MenuManager.html#method_getFocusedMenuItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "getItem", "url": "YAHOO.widget.Menu.html#method_getItem", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_getItemGroup", "url": "YAHOO.widget.Menu.html#method__getItemGroup", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "getItemGroups", "url": "YAHOO.widget.Menu.html#method_getItemGroups", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "getItems", "url": "YAHOO.widget.Menu.html#method_getItems", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getMenu", "url": "YAHOO.widget.MenuManager.html#method_getMenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getMenuItem", "url": "YAHOO.widget.MenuManager.html#method_getMenuItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getMenuItemGroup", "url": "YAHOO.widget.MenuManager.html#method_getMenuItemGroup", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "getMenuRootElement", "url": "YAHOO.widget.MenuManager.html#method_getMenuRootElement", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getMenus", "url": "YAHOO.widget.MenuManager.html#method_getMenus", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "getNextEnabledSibling", "url": "YAHOO.widget.MenuItem.html#method_getNextEnabledSibling", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "getPreviousEnabledSibling", "url": "YAHOO.widget.MenuItem.html#method_getPreviousEnabledSibling", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "getRoot", "url": "YAHOO.widget.Menu.html#method_getRoot", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "getSubmenus", "url": "YAHOO.widget.Menu.html#method_getSubmenus", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "getVisible", "url": "YAHOO.widget.MenuManager.html#method_getVisible", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "groupIndex", "url": "YAHOO.widget.MenuItem.html#property_groupIndex", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "GROUP_TITLE_TAG_NAME", "url": "YAHOO.widget.Menu.html#property_GROUP_TITLE_TAG_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "hasFocus", "url": "YAHOO.widget.Menu.html#method_hasFocus", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "hasFocus", "url": "YAHOO.widget.MenuItem.html#method_hasFocus", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "helptext", "url": "YAHOO.widget.MenuItem.html#config_helptext", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "hidedelay", "url": "YAHOO.widget.Menu.html#config_hidedelay", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "hideVisible", "url": "YAHOO.widget.MenuManager.html#method_hideVisible", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "id", "url": "YAHOO.widget.MenuItem.html#property_id", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "iframe", "url": "YAHOO.widget.Menu.html#config_iframe", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "index", "url": "YAHOO.widget.MenuItem.html#property_index", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "init", "url": "YAHOO.widget.Menu.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuBarItem", "name": "init", "url": "YAHOO.widget.MenuBarItem.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "init", "url": "YAHOO.widget.MenuBar.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "init", "url": "YAHOO.widget.ContextMenu.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "init", "url": "YAHOO.widget.MenuItem.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "initDefaultConfig", "url": "YAHOO.widget.Menu.html#method_initDefaultConfig", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "initDefaultConfig", "url": "YAHOO.widget.MenuBar.html#method_initDefaultConfig", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "initDefaultConfig", "url": "YAHOO.widget.ContextMenu.html#method_initDefaultConfig", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "initDefaultConfig", "url": "YAHOO.widget.MenuItem.html#method_initDefaultConfig", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "initEvents", "url": "YAHOO.widget.Menu.html#method_initEvents", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "initEvents", "url": "YAHOO.widget.ContextMenu.html#method_initEvents", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_initSubTree", "url": "YAHOO.widget.Menu.html#method__initSubTree", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_initSubTree", "url": "YAHOO.widget.MenuItem.html#method__initSubTree", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "insertItem", "url": "YAHOO.widget.Menu.html#method_insertItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "itemAddedEvent", "url": "YAHOO.widget.Menu.html#event_itemAddedEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "itemData", "url": "YAHOO.widget.Menu.html#property_itemData", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "itemRemovedEvent", "url": "YAHOO.widget.Menu.html#event_itemRemovedEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "ITEM_TYPE", "url": "YAHOO.widget.Menu.html#property_ITEM_TYPE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "keepopen", "url": "YAHOO.widget.Menu.html#config_keepopen", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "keyDownEvent", "url": "YAHOO.widget.Menu.html#event_keyDownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "keyDownEvent", "url": "YAHOO.widget.MenuItem.html#event_keyDownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "keylistener", "url": "YAHOO.widget.MenuItem.html#config_keylistener", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "keyPressEvent", "url": "YAHOO.widget.Menu.html#event_keyPressEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "keyPressEvent", "url": "YAHOO.widget.MenuItem.html#event_keyPressEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "keyUpEvent", "url": "YAHOO.widget.Menu.html#event_keyUpEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "keyUpEvent", "url": "YAHOO.widget.MenuItem.html#event_keyUpEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "lazyLoad", "url": "YAHOO.widget.Menu.html#property_lazyLoad", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "maxheight", "url": "YAHOO.widget.Menu.html#config_maxheight", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "minscrollheight", "url": "YAHOO.widget.Menu.html#config_minscrollheight", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "mouseDownEvent", "url": "YAHOO.widget.Menu.html#event_mouseDownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "mouseDownEvent", "url": "YAHOO.widget.MenuItem.html#event_mouseDownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "mouseOutEvent", "url": "YAHOO.widget.Menu.html#event_mouseOutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "mouseOutEvent", "url": "YAHOO.widget.MenuItem.html#event_mouseOutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "mouseOverEvent", "url": "YAHOO.widget.Menu.html#event_mouseOverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "mouseOverEvent", "url": "YAHOO.widget.MenuItem.html#event_mouseOverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "mouseUpEvent", "url": "YAHOO.widget.Menu.html#event_mouseUpEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "mouseUpEvent", "url": "YAHOO.widget.MenuItem.html#event_mouseUpEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_nCurrentMouseX", "url": "YAHOO.widget.Menu.html#property__nCurrentMouseX", "type": "property"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_oAnchor", "url": "YAHOO.widget.MenuItem.html#property__oAnchor", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "OFF_SCREEN_POSITION", "url": "YAHOO.widget.Menu.html#property_OFF_SCREEN_POSITION", "type": "property"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_oHelpTextEM", "url": "YAHOO.widget.MenuItem.html#property__oHelpTextEM", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onBeforeHide", "url": "YAHOO.widget.Menu.html#method__onBeforeHide", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onBeforeRender", "url": "YAHOO.widget.Menu.html#method__onBeforeRender", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onBeforeShow", "url": "YAHOO.widget.Menu.html#method__onBeforeShow", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onBlur", "url": "YAHOO.widget.Menu.html#method__onBlur", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onClick", "url": "YAHOO.widget.Menu.html#method__onClick", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.MenuBar", "name": "_onClick", "url": "YAHOO.widget.MenuBar.html#method__onClick", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "onclick", "url": "YAHOO.widget.MenuItem.html#config_onclick", "type": "config"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onDOMEvent", "url": "YAHOO.widget.MenuManager.html#method_onDOMEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onHide", "url": "YAHOO.widget.Menu.html#method__onHide", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onInit", "url": "YAHOO.widget.Menu.html#method__onInit", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onItemAdded", "url": "YAHOO.widget.MenuManager.html#method_onItemAdded", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onItemAdded", "url": "YAHOO.widget.Menu.html#method__onItemAdded", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onItemDestroy", "url": "YAHOO.widget.MenuManager.html#method_onItemDestroy", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onKeyDown", "url": "YAHOO.widget.Menu.html#method__onKeyDown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuBar", "name": "_onKeyDown", "url": "YAHOO.widget.MenuBar.html#method__onKeyDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onKeyPress", "url": "YAHOO.widget.Menu.html#method__onKeyPress", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onMenuBlur", "url": "YAHOO.widget.MenuManager.html#method_onMenuBlur", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onMenuDestroy", "url": "YAHOO.widget.MenuManager.html#method_onMenuDestroy", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onMenuFocus", "url": "YAHOO.widget.MenuManager.html#method_onMenuFocus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onMenuHide", "url": "YAHOO.widget.MenuManager.html#method_onMenuHide", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onMenuItemConfigChange", "url": "YAHOO.widget.Menu.html#method__onMenuItemConfigChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onMenuItemDestroy", "url": "YAHOO.widget.Menu.html#method__onMenuItemDestroy", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onMenuShow", "url": "YAHOO.widget.MenuManager.html#method_onMenuShow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "onMenuVisibleConfigChange", "url": "YAHOO.widget.MenuManager.html#method_onMenuVisibleConfigChange", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onMouseMove", "url": "YAHOO.widget.Menu.html#method__onMouseMove", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onMouseOut", "url": "YAHOO.widget.Menu.html#method__onMouseOut", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onMouseOver", "url": "YAHOO.widget.Menu.html#method__onMouseOver", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onParentMenuConfigChange", "url": "YAHOO.widget.Menu.html#method__onParentMenuConfigChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onParentMenuRender", "url": "YAHOO.widget.Menu.html#method__onParentMenuRender", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onRender", "url": "YAHOO.widget.Menu.html#method__onRender", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onScrollTargetMouseOut", "url": "YAHOO.widget.Menu.html#method__onScrollTargetMouseOut", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onScrollTargetMouseOver", "url": "YAHOO.widget.Menu.html#method__onScrollTargetMouseOver", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onShow", "url": "YAHOO.widget.Menu.html#method__onShow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_onSubmenuBeforeHide", "url": "YAHOO.widget.MenuItem.html#method__onSubmenuBeforeHide", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "_onTriggerClick", "url": "YAHOO.widget.ContextMenu.html#method__onTriggerClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "_onTriggerContextMenu", "url": "YAHOO.widget.ContextMenu.html#method__onTriggerContextMenu", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_onVisibleChange", "url": "YAHOO.widget.Menu.html#method__onVisibleChange", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Menu", "name": "_onYChange", "url": "YAHOO.widget.Menu.html#method__onYChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_oOnclickAttributeValue", "url": "YAHOO.widget.MenuItem.html#property__oOnclickAttributeValue", "type": "property"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_oSubmenu", "url": "YAHOO.widget.MenuItem.html#property__oSubmenu", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "_oTrigger", "url": "YAHOO.widget.ContextMenu.html#property__oTrigger", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "parent", "url": "YAHOO.widget.Menu.html#property_parent", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "parent", "url": "YAHOO.widget.MenuItem.html#property_parent", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "position", "url": "YAHOO.widget.Menu.html#config_position", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "position", "url": "YAHOO.widget.MenuBar.html#config_position", "type": "config"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "position", "url": "YAHOO.widget.ContextMenu.html#method_position", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "positionOffScreen", "url": "YAHOO.widget.Menu.html#method_positionOffScreen", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "preventcontextoverlap", "url": "YAHOO.widget.Menu.html#config_preventcontextoverlap", "type": "config"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "removeClassNameForState", "url": "YAHOO.widget.MenuItem.html#method_removeClassNameForState", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ContextMenu", "name": "_removeEventHandlers", "url": "YAHOO.widget.ContextMenu.html#method__removeEventHandlers", "type": "method"}, {"access": "private", "host": "YAHOO.widget.MenuManager", "name": "removeItem", "url": "YAHOO.widget.MenuManager.html#method_removeItem", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "removeItem", "url": "YAHOO.widget.Menu.html#method_removeItem", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_removeItemFromGroupByIndex", "url": "YAHOO.widget.Menu.html#method__removeItemFromGroupByIndex", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_removeItemFromGroupByValue", "url": "YAHOO.widget.Menu.html#method__removeItemFromGroupByValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "removeMenu", "url": "YAHOO.widget.MenuManager.html#method_removeMenu", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_sClassName", "url": "YAHOO.widget.Menu.html#property__sClassName", "type": "property"}, {"access": "private", "host": "YAHOO.widget.MenuItem", "name": "_sClassName", "url": "YAHOO.widget.MenuItem.html#property__sClassName", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "scrollincrement", "url": "YAHOO.widget.Menu.html#config_scrollincrement", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "selected", "url": "YAHOO.widget.MenuItem.html#config_selected", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "setInitialFocus", "url": "YAHOO.widget.Menu.html#method_setInitialFocus", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "setInitialSelection", "url": "YAHOO.widget.Menu.html#method_setInitialSelection", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "setItemGroupTitle", "url": "YAHOO.widget.Menu.html#method_setItemGroupTitle", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_setMaxHeight", "url": "YAHOO.widget.Menu.html#method__setMaxHeight", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_setScrollHeight", "url": "YAHOO.widget.Menu.html#method__setScrollHeight", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "shadow", "url": "YAHOO.widget.Menu.html#config_shadow", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "showdelay", "url": "YAHOO.widget.Menu.html#config_showdelay", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "srcElement", "url": "YAHOO.widget.Menu.html#property_srcElement", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "srcElement", "url": "YAHOO.widget.MenuItem.html#property_srcElement", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "strongemphasis", "url": "YAHOO.widget.MenuItem.html#config_strongemphasis", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "submenu", "url": "YAHOO.widget.MenuItem.html#config_submenu", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "submenualignment", "url": "YAHOO.widget.Menu.html#config_submenualignment", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "submenualignment", "url": "YAHOO.widget.MenuBar.html#config_submenualignment", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "submenuhidedelay", "url": "YAHOO.widget.Menu.html#config_submenuhidedelay", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "submenutoggleregion", "url": "YAHOO.widget.MenuBar.html#config_submenutoggleregion", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "SUBMENU_TOGGLE_REGION_WIDTH", "url": "YAHOO.widget.MenuBar.html#property_SUBMENU_TOGGLE_REGION_WIDTH", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "SUBMENU_TYPE", "url": "YAHOO.widget.MenuItem.html#property_SUBMENU_TYPE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "subscribe", "url": "YAHOO.widget.Menu.html#method_subscribe", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_subscribeToItemEvents", "url": "YAHOO.widget.Menu.html#method__subscribeToItemEvents", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "target", "url": "YAHOO.widget.MenuItem.html#config_target", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "text", "url": "YAHOO.widget.MenuItem.html#config_text", "type": "config"}, {"access": "", "host": "YAHOO.widget.MenuManager", "name": "toString", "url": "YAHOO.widget.MenuManager.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "toString", "url": "YAHOO.widget.Menu.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuBarItem", "name": "toString", "url": "YAHOO.widget.MenuBarItem.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuBar", "name": "toString", "url": "YAHOO.widget.MenuBar.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "toString", "url": "YAHOO.widget.ContextMenu.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "toString", "url": "YAHOO.widget.MenuItem.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "trigger", "url": "YAHOO.widget.ContextMenu.html#config_trigger", "type": "config"}, {"access": "", "host": "YAHOO.widget.ContextMenu", "name": "triggerContextMenuEvent", "url": "YAHOO.widget.ContextMenu.html#event_triggerContextMenuEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_updateItemProperties", "url": "YAHOO.widget.Menu.html#method__updateItemProperties", "type": "method"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "url", "url": "YAHOO.widget.MenuItem.html#config_url", "type": "config"}, {"access": "private", "host": "YAHOO.widget.Menu", "name": "_useHideDelay", "url": "YAHOO.widget.Menu.html#property__useHideDelay", "type": "property"}, {"access": "", "host": "YAHOO.widget.MenuItem", "name": "value", "url": "YAHOO.widget.MenuItem.html#property_value", "type": "property"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "visible", "url": "YAHOO.widget.Menu.html#config_visible", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "x", "url": "YAHOO.widget.Menu.html#config_x", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "xy", "url": "YAHOO.widget.Menu.html#config_xy", "type": "config"}, {"access": "", "host": "YAHOO.widget.Menu", "name": "y", "url": "YAHOO.widget.Menu.html#config_y", "type": "config"}];
</script>
</body>
</html>
